Major overhauling and refactoring of Magallanes Command and Tasks modulairty and workflow.

ADVICE: there is no Backwards Compatibility with custom tasks, those
using the _config instance will be broken or those using the
getEnvironmentName().
This commit is contained in:
Andrés Montañez
2012-09-21 00:23:07 -03:00
parent 05b102b273
commit 811c83e13a
29 changed files with 803 additions and 639 deletions
+5 -4
View File
@@ -1,12 +1,13 @@
<?php
class Mage_Task_Init
class Mage_Command_BuiltIn_Init
extends Mage_Command_CommandAbstract
{
public function run()
{
$configDir = '.mage';
Mage_Console::output('Initiating managing process for application with <dark_gray>Magallanes</dark_gray>');
// Check if there is already a config dir
if (file_exists($configDir)) {
Mage_Console::output('<light_red>Error!!</light_red> Already exists <dark_gray>.mage</dark_gray> directory.', 1, 2);
@@ -19,7 +20,7 @@ class Mage_Task_Init
$results[] = mkdir($configDir . '/config/environment');
$results[] = file_put_contents($configDir . '/config/general.yml', '#global settings' . PHP_EOL . PHP_EOL);
$results[] = file_put_contents($configDir . '/config/scm.yml', '#scm settings' . PHP_EOL . PHP_EOL);
if (!in_array(false, $results)) {
Mage_Console::output('<light_green>Success!!</light_green> The configuration for <dark_gray>Magallanes</dark_gray> has been generated at <blue>.mage</blue> directory.');
Mage_Console::output('<dark_gray>Please!! Review and adjust the configuration.</dark_gray>', 2, 2);