|
|
@ -48,6 +48,12 @@ class Mage_Console |
|
|
|
|
|
|
|
|
|
|
|
} else if ($this->_args[0] == 'init') { |
|
|
|
} else if ($this->_args[0] == 'init') { |
|
|
|
$this->_action = 'init'; |
|
|
|
$this->_action = 'init'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if ($this->_args[0] == 'lock') { |
|
|
|
|
|
|
|
$this->_action = 'lock'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if ($this->_args[0] == 'unlock') { |
|
|
|
|
|
|
|
$this->_action = 'unlock'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->_args as $argument) { |
|
|
|
foreach ($this->_args as $argument) { |
|
|
@ -158,67 +164,79 @@ class Mage_Console |
|
|
|
Mage_Console::output('<red>You must indicate a task</red>', 0, 2); |
|
|
|
Mage_Console::output('<red>You must indicate a task</red>', 0, 2); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
switch ($this->_args[1]) { |
|
|
|
|
|
|
|
case 'list': |
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'rollback': |
|
|
|
if ($this->_args[1] == 'list') { |
|
|
|
if (!isset($this->_args[2])) { |
|
|
|
$task->setAction('list'); |
|
|
|
Mage_Console::output('<red>You must indicate a release point</red>', 0, 2); |
|
|
|
|
|
|
|
break 2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
} else if ($this->_args[1] == 'rollback') { |
|
|
|
$task->setRelease($this->_args[2]); |
|
|
|
if (!isset($this->_args[2])) { |
|
|
|
|
|
|
|
Mage_Console::output('<red>You must indicate a release point</red>', 0, 2); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
|
|
|
|
$task->setRelease($this->_args[2]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Mage_Console::output('<red>Invalid Releases task</red>', 0, 2); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$task->run($config); |
|
|
|
$task->run($config); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'update'; |
|
|
|
case 'update'; |
|
|
|
$task = new Mage_Task_Update; |
|
|
|
$task = new Mage_Task_Update; |
|
|
|
$task->run($config); |
|
|
|
$task->run($config); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'compile'; |
|
|
|
case 'compile'; |
|
|
|
$task = new Mage_Task_Compile; |
|
|
|
$task = new Mage_Task_Compile; |
|
|
|
$task->run($config); |
|
|
|
$task->run($config); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'install'; |
|
|
|
case 'install'; |
|
|
|
$task = new Mage_Task_Install; |
|
|
|
$task = new Mage_Task_Install; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'lock'; |
|
|
|
|
|
|
|
$task = new Mage_Task_Lock; |
|
|
|
|
|
|
|
$task->run($config); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'unlock'; |
|
|
|
|
|
|
|
$task = new Mage_Task_Lock; |
|
|
|
|
|
|
|
$task->run($config, true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'upgrade'; |
|
|
|
case 'upgrade'; |
|
|
|
$task = new Mage_Task_Upgrade; |
|
|
|
$task = new Mage_Task_Upgrade; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'init'; |
|
|
|
case 'init'; |
|
|
|
$task = new Mage_Task_Init; |
|
|
|
$task = new Mage_Task_Init; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'add'; |
|
|
|
case 'add'; |
|
|
|
switch ($this->_args[1]) { |
|
|
|
switch ($this->_args[1]) { |
|
|
|
case 'environment': |
|
|
|
case 'environment': |
|
|
|
if (isset($this->_args[3]) && ($this->_args[3] == '--with-releases')) { |
|
|
|
if (isset($this->_args[3]) && ($this->_args[3] == '--with-releases')) { |
|
|
|
$withRelases = true; |
|
|
|
$withRelases = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$withRelases = false; |
|
|
|
$withRelases = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$task = new Mage_Task_Add; |
|
|
|
$task = new Mage_Task_Add; |
|
|
|
$task->environment($this->_args[2], $withRelases); |
|
|
|
$task->environment($this->_args[2], $withRelases); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'version'; |
|
|
|
case 'version'; |
|
|
|
$this->showVersion(); |
|
|
|
$this->showVersion(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
Mage_Console::output('<red>Invalid action</red>', 0, 2); |
|
|
|
Mage_Console::output('<red>Invalid action</red>', 0, 2); |
|
|
|