Added possibility to override config from cli

This commit is contained in:
Vyacheslav Ganzin 2013-11-28 19:55:52 +02:00
parent f8b5cb2f59
commit 0eebe8bea1
2 changed files with 13 additions and 1 deletions

View file

@ -98,6 +98,8 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
*/
public function run()
{
$this->getConfig()->overrideConfigWithCLIArguments();
// Check if Environment is not Locked
$lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock';
if (file_exists($lockFile)) {

View file

@ -487,4 +487,14 @@ class Config
}
}
}
public function overrideConfigWithCLIArguments()
{
$filter = function(&$item, $key) {
if (in_array($key, array_keys($this->getParameters()))) {
$item = $this->getParameter($key);
}
};
array_walk_recursive($this->config, $filter);
}
}