update comment and add check to command metho_exists.
This commit is contained in:
parent
53a20533f1
commit
09da91501d
|
@ -32,17 +32,17 @@ public static function run($arguments = array())
|
||||||
// container instead of by this class.
|
// container instead of by this class.
|
||||||
if (Bundle::exists($bundle)) Bundle::start($bundle);
|
if (Bundle::exists($bundle)) Bundle::start($bundle);
|
||||||
|
|
||||||
// Once the bundle has been started, we will attempt to resolve the task
|
|
||||||
// instance. Tasks may be resolved through the file system or through
|
|
||||||
// the application IoC container.
|
|
||||||
$task = static::resolve($bundle, $task);
|
$task = static::resolve($bundle, $task);
|
||||||
|
|
||||||
|
// Once the bundle has been resolved, we'll make sure we could actually
|
||||||
|
// find that task, and then verify that the method exists on the task
|
||||||
|
// so we can successfully call it without a problem.
|
||||||
if (is_null($task))
|
if (is_null($task))
|
||||||
{
|
{
|
||||||
throw new \Exception("Sorry, I can't find that task.");
|
throw new \Exception("Sorry, I can't find that task.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(method_exists($task, $method))
|
if(method_exists($task, $method) or method_exists($task, '__call'))
|
||||||
{
|
{
|
||||||
$task->$method(array_slice($arguments, 1));
|
$task->$method(array_slice($arguments, 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue