【发布时间】:2018-02-11 20:24:48
【问题描述】:
我正在尝试在控制器中执行自定义 Artisan 命令,但它会引发 CommandNotFound 异常。在实现中我运行命令,而不是执行整个命令'php artisan scan {url}',我只是运行扫描{url},因为这个答案:Running Artisan Command。我不明白我做错了什么?
自定义 Artisan 命令签名
protected $signature = 'scan {url}
{--r= : y or n | to follow or not to follow the robot.txt}
{--fm= : set follow mode}
{--u= : username}
{--p= : password}
{--s : SQL module}
{--x : XSS module}';
实施
switch ($select) {
case 'full':
\Artisan::call('scan ' . $customer->cms_url); //url == http://localhost:8888
return $request;
break;
}
错误
1/1) CommandNotFoundException
There are no commands defined in the "scan http" namespace.
in Application.php (line 548)
at Application->findNamespace('scan http')
in Application.php (line 582)
at Application->find('scan http://localhost:8888')
in Application.php (line 205)
【问题讨论】:
标签: laravel command laravel-artisan