这是/ application / app /命令中我的命令的fire方法,当我使用'$ php artisan commandname'通过Artisan运行命令时会发生什么:
public function fire() {
echo 'hello world';
// this prints just fine to the CLI.
echo curl_exec(curl_init('http://localhost:8000/fetch/query'));
// the url gets pinged as expected
return Redirect::to('/fetch/query');
// this does not work. The command terminates and the url is not pinged.
}
此外,如果有人有更好的策略来进行这些预定的网址访问,我很满意。感谢!!!