Writing command line scripts for your ZF application

David Caunt has posted an article on how to access your Zend_Application resources from a command line application:

As PHP developers, it is convenient to be able to write command line scripts in PHP. In doing so, you will almost certainly want access to Zend Framework components and their configurations as if you are writing a normal MVC app, but without invoking the MVC stack and without loading unnecessary resources. I’ve seen solutions where actions are exposed as controller actions and called by wget – these are counter-intuitive, inefficient, and will suffer from max execution timeouts and other problems.

He then shows how to write a bootstrap file that only loads the resources required, so you are ready to write a command line script that interacts with you ZF application.

Posted by Rob on 25th February 2010 under Around the web | Comments Off

Comments are closed.