Create cronjob with Zend Framework

前端 未结 13 2117
广开言路
广开言路 2020-12-13 14:32

I am trying to write a cronjob controller, so I can call one website and have all modules cronjob.php executed. Now my problem is how do I do that?

Would curl be an

相关标签:
13条回答
  • 2020-12-13 15:18

    Why not just create a crontab.php, including, or requiring the index.php bootstrap file?

    Considering that the bootstrap is executing Zend_Loader::registerAutoload(), you can start working directly with the modules, for instance, myModules_MyClass::doSomething();

    That way you are skipping the controllers. The Controller job is to control the access via http. In this case, you don't need the controller approach because you are accessing locally.

    0 讨论(0)
提交回复
热议问题