Fixed problem with manual running of Artisan tasks

When running an Artisan task from within your application using `Command::run`, it fails when the same task is ran more than once. Every time the task is resolved, its file is included using `require` leading to duplicate class definitions. By using `require_once` this problem is avoided.
This commit is contained in:
Joost Koehoorn 2012-09-03 16:42:14 +03:00
parent ec13efb743
commit a1c7dde08b
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ public static function resolve($bundle, $task)
// the requested method may be executed. // the requested method may be executed.
if (file_exists($path = Bundle::path($bundle).'tasks/'.$task.EXT)) if (file_exists($path = Bundle::path($bundle).'tasks/'.$task.EXT))
{ {
require $path; require_once $path;
$task = static::format($bundle, $task); $task = static::format($bundle, $task);