mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Use the injector for creating tasks.
This commit is contained in:
parent
1a43ad5ed3
commit
5e6813c02a
@ -66,7 +66,7 @@ class TaskRunner extends Controller {
|
||||
if(Director::is_cli()) echo "Running task '$title'...\n\n";
|
||||
elseif(!Director::is_ajax()) echo "<h1>Running task '$title'...</h1>\n";
|
||||
|
||||
$task = new $taskName();
|
||||
$task = Injector::inst()->create($taskName);
|
||||
if ($task->isEnabled()) $task->run($request);
|
||||
else echo "<p>{$title} is disabled</p>";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user