From a1c7dde08bf60dcd916d529bcc315234e676d844 Mon Sep 17 00:00:00 2001 From: Joost Koehoorn Date: Mon, 3 Sep 2012 16:42:14 +0300 Subject: [PATCH] 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. --- laravel/cli/command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/cli/command.php b/laravel/cli/command.php index 113881c2..c6a25ee4 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -125,7 +125,7 @@ public static function resolve($bundle, $task) // the requested method may be executed. if (file_exists($path = Bundle::path($bundle).'tasks/'.$task.EXT)) { - require $path; + require_once $path; $task = static::format($bundle, $task);