From 5e6813c02af191eefdf9c27732c2b53b053e2888 Mon Sep 17 00:00:00 2001 From: ajshort Date: Fri, 8 Feb 2013 00:32:16 +1100 Subject: [PATCH] Use the injector for creating tasks. --- dev/TaskRunner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/TaskRunner.php b/dev/TaskRunner.php index f3edfc659..67fafd32c 100644 --- a/dev/TaskRunner.php +++ b/dev/TaskRunner.php @@ -66,7 +66,7 @@ class TaskRunner extends Controller { if(Director::is_cli()) echo "Running task '$title'...\n\n"; elseif(!Director::is_ajax()) echo "

Running task '$title'...

\n"; - $task = new $taskName(); + $task = Injector::inst()->create($taskName); if ($task->isEnabled()) $task->run($request); else echo "

{$title} is disabled

"; } else {