在 Kohana 3 中如何可能在控制器的 action_index 方法中并使用类似此代码的内容
exec("php index.php --uri=home/other_method");
...在后台运行“other_method”?我在“home/index”中,想将“home/other_method”作为后台任务调用。我不想等待网页响应,“other_method”最多可能需要 3 分钟才能完成。
我不想使用队列,我想在没有 Minion 的情况下这样做。
这可能吗?无论我尝试什么,我都无法让“other_method”做出回应。我可以直接访问它,甚至可以使用服务器上的 CRON 作业来调用我的 exec() 代码。
为什么我不能在 action_index 中通过 exec() 访问它?是否有另一种方法可以使用 kohana 线程调用“other_method”,以便我可以继续使用 action_index?
(另外,我在 Mac 上使用 MAMP 编码。也许它与环境有关?)