Tweak clones.

This commit is contained in:
Andrés Montañez
2014-10-11 17:47:07 -02:00
parent e40b7d21c9
commit 2deaa27a2a
4 changed files with 15 additions and 28 deletions
+5 -26
View File
@@ -121,29 +121,6 @@ class Config
return $this->parseConfigFile($filePath);
}
/**
* Obviously this method is a HACK. It was refactored from ::loadEnvironment()
* TODO Please put it to SCM functionality.
*
* @param array $settings
*
* @return array
*/
protected function updateSCMTempDir(array $settings)
{
// Create temporal directory for clone
if (isset($settings['deployment']['source']) && is_array($settings['deployment']['source'])) {
if (trim($settings['deployment']['source']['temporal']) == '') {
$settings['deployment']['source']['temporal'] = sys_get_temp_dir();
}
$settings['deployment']['source']['temporal']
= rtrim($settings['deployment']['source']['temporal'], '/') . '/' . md5(microtime()) . '/';
}
return $settings;
}
/**
* Loads the Environment configuration
* @param $filePath string
@@ -156,9 +133,6 @@ class Config
$settings = $this->parseConfigFile($filePath);
//this is a HACK in the old code - no time to remove it now, so I factored it out in own method
$settings = $this->updateSCMTempDir($settings);
return $settings;
}
@@ -490,6 +464,11 @@ class Config
}
}
public function setSourceTemporal($directory)
{
$this->environmentConfig['deployment']['source']['temporal'] = $directory;
}
/**
* Returns Releasing Options
*