mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 10:08:56 +02:00
New version. Added getters to config and task.
New concept of "stage" where the task runs.
This commit is contained in:
@@ -8,7 +8,7 @@ class Mage_Task_Factory
|
||||
* @param boolean $inRollback
|
||||
* @return Mage_Task_TaskAbstract
|
||||
*/
|
||||
public static function get($taskName, Mage_Config $taskConfig, $inRollback = false)
|
||||
public static function get($taskName, Mage_Config $taskConfig, $inRollback = false, $stage = null)
|
||||
{
|
||||
$instance = null;
|
||||
$taskName = ucwords(str_replace('-', ' ', $taskName));
|
||||
@@ -17,12 +17,12 @@ class Mage_Task_Factory
|
||||
if (strpos($taskName, '/') === false) {
|
||||
Mage_Autoload::loadUserTask($taskName);
|
||||
$className = 'Task_' . ucfirst($taskName);
|
||||
$instance = new $className($taskConfig, $inRollback);
|
||||
$instance = new $className($taskConfig, $inRollback, $stage);
|
||||
|
||||
} else {
|
||||
$taskName = str_replace(' ', '_', ucwords(str_replace('/', ' ', $taskName)));
|
||||
$className = 'Mage_Task_BuiltIn_' . $taskName;
|
||||
$instance = new $className($taskConfig, $inRollback);
|
||||
$instance = new $className($taskConfig, $inRollback, $stage);
|
||||
}
|
||||
|
||||
assert($instance instanceOf Mage_Task_TaskAbstract);
|
||||
|
||||
Reference in New Issue
Block a user