New feature: Override Release.

This commit is contained in:
Andrés Montañez
2012-03-31 00:33:17 -03:00
parent aaa65800d0
commit 0410c0efec
6 changed files with 54 additions and 15 deletions
+19 -2
View File
@@ -1,9 +1,9 @@
<?php
class Mage_Console
{
private $_args = null;
private $_args = array();
private $_action = null;
private $_actionOptions = null;
private static $_actionOptions = array();
private $_environment = null;
private static $_log = null;
private static $_logEnabled = true;
@@ -50,6 +50,14 @@ class Mage_Console
foreach ($this->_args as $argument) {
if (preg_match('/to:[\w]+/i', $argument)) {
$this->_environment = str_replace('to:', '', $argument);
} else if (preg_match('/--[\w]+/i', $argument)) {
$optionValue = explode('=', substr($argument, 2));
if (count($optionValue) == 1) {
self::$_actionOptions[$optionValue[0]] = true;
} else if (count($optionValue) == 2) {
self::$_actionOptions[$optionValue[0]] = $optionValue[1];
}
}
}
}
@@ -64,6 +72,15 @@ class Mage_Console
return $this->_environment;
}
public static function getActionOption($name, $default = false)
{
if (isset(self::$_actionOptions[$name])) {
return self::$_actionOptions[$name];
} else {
return $default;
}
}
public static function output($message, $tabs = 1, $newLine = 1)
{
self::log(strip_tags($message));