Create cronjob with Zend Framework

前端 未结 13 2124
广开言路
广开言路 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条回答
  •  -上瘾入骨i
    2020-12-13 15:06

    I extended gregor answer with this post. This is what came out:

    //public/index.php 
    
    // Run application, only if not started from command line (cli)
    if (php_sapi_name() != 'cli' || !empty($_SERVER['REMOTE_ADDR'])) {
        $application->run();
    }
    

    Thanks gregor!

提交回复
热议问题