开发者

Creating a php script to run as cron job - using the Zend Framework library

I am creating a php script that would be called as a cron job. However I need to use the functionalities of the Zend framework. The thing is that relative referencing of files especially in includes don't work when programming for being run via command line so I'm stuck with how do I use the zend libraries here. I don't want to go in and change开发者_运维知识库 every single require_once statement.


Your PHP is probably using a different php.ini file when called through the CLI (Command Line Interface).

Use php_sapi_name() to detect whether you're running in CLI mode, and set_include_path() to force the correct include path.


You should be able to use set_include_path to set the include path of the Zend lib.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜