mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 10:08:56 +02:00
Changes on console feedback colors. Example of User Tasks.
This commit is contained in:
+16
-4
@@ -7,10 +7,22 @@ class Mage_Task_Factory
|
||||
* @param string $taskName
|
||||
* @return Mage_Task_TaskAbstract
|
||||
*/
|
||||
public static function get($taskName)
|
||||
public static function get($taskName, $taskConfig)
|
||||
{
|
||||
$taskName = str_replace(' ', '_', ucwords(str_replace('/', ' ', $taskName)));
|
||||
$className = 'Mage_Task_BuiltIn_' . $taskName;
|
||||
return new $className;
|
||||
$instance = null;
|
||||
|
||||
if (strpos($taskName, '/') === false) {
|
||||
Mage_Autoload::loadUserTask($taskName);
|
||||
$className = 'Task_' . ucfirst($taskName);
|
||||
$instance = new $className($taskConfig);
|
||||
|
||||
} else {
|
||||
$taskName = str_replace(' ', '_', ucwords(str_replace('/', ' ', $taskName)));
|
||||
$className = 'Mage_Task_BuiltIn_' . $taskName;
|
||||
$instance = new $className($taskConfig);
|
||||
}
|
||||
|
||||
assert($instance instanceOf Mage_Task_TaskAbstract);
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user