mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 10:08:56 +02:00
Allow parameter configuration on the Task configuration definition.
This commit is contained in:
@@ -4,16 +4,18 @@ abstract class Mage_Task_TaskAbstract
|
||||
protected $_config = null;
|
||||
protected $_inRollback = false;
|
||||
protected $_stage = null;
|
||||
protected $_parameters = array();
|
||||
|
||||
public abstract function getName();
|
||||
|
||||
public abstract function run();
|
||||
|
||||
public final function __construct(Mage_Config $config, $inRollback = false, $stage = null)
|
||||
public final function __construct(Mage_Config $config, $inRollback = false, $stage = null, $parameters = array())
|
||||
{
|
||||
$this->_config = $config;
|
||||
$this->_inRollback = $inRollback;
|
||||
$this->_stage = $stage;
|
||||
$this->_parameters = $parameters;
|
||||
}
|
||||
|
||||
public function inRollback()
|
||||
@@ -35,6 +37,17 @@ abstract class Mage_Task_TaskAbstract
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the a parameter
|
||||
*
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function getParameter($name, $default = null)
|
||||
{
|
||||
return $this->getConfig()->getParameter($name, $default, $this->_parameters);
|
||||
}
|
||||
|
||||
protected final function _runLocalCommand($command, &$output = null)
|
||||
{
|
||||
return Mage_Console::executeCommand($command, $output);
|
||||
|
||||
Reference in New Issue
Block a user