Laravel 4:artisan命令中的重定向不起作用
我是新手。我正在尝试创建一个调度器,这样cron就可以每隔一段时间通过执行artisan命令来调用url,该命令实际上会路由调用。我在正确构建命令时遇到问题 下面是我在/Application/app/commands中的命令的fire方法,以及当我通过Artisan使用“$php Artisan commandname”运行命令时会发生什么:Laravel 4:artisan命令中的重定向不起作用,laravel,cron,Laravel,Cron,我是新手。我正在尝试创建一个调度器,这样cron就可以每隔一段时间通过执行artisan命令来调用url,该命令实际上会路由调用。我在正确构建命令时遇到问题 下面是我在/Application/app/commands中的命令的fire方法,以及当我通过Artisan使用“$php Artisan commandname”运行命令时会发生什么: public function fire() { echo 'hello world'; // this prints just
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.
}
此外,如果有人有更好的策略来进行这些预定的url访问,我洗耳恭听。谢谢 返回重定向::到“/fetch/query”怎么样?是的,很抱歉输入错误。我回来了。