Like ZF noob himself, I think I understand some of what the OP is trying to figure out. So, Iβll just explain that I understand in the hope that this is useful either to the OP (or, rather, to the future reader, since the original question is so old and I believe that the OP is now a ZF guru).
I understand that ZF claims it pretty much βuses it as it sees fit," so you donβt have to buy the whole structure like Zend_Application, Zend_Bootstrap class, the whole MVC approach, etc.
In addition, I understand the conventions for class names and file locations, which make it easy to load startup. Example: class App_Model_User is located in the App/Model/User.php
I think it could be potentially confusing what is in the context of the script where you are not
- made .htaccess magic that repels the whole request
public/index.php - set
APPLICATION_PATH and include the paths in public/index.php - created your
Application or Bootstrap object bound to the configuration file
it may be a little unclear what is the best way to take advantage of most of the ZF kindness we get in this context and want in a different context.
I think my answer to the original question would be that the usual sequence of entry points
http request -> .htaccess -> index.php -> config
installs most of our environment for us, we will need to duplicate some of them for different input paths.
So, for your script, my first instinct will be to create a shared include file that reflects a lot of what is going on in index.php - sets the inclusion paths, APPLICATION_PATH, creates instances and invokes loading, and then does your script special processing .
Even better, it might be advisable to create a single entry point for all your scripts, for example, in the context of http / web. Extend Zend_Application for your own script purposes to $application->run(); no longer triggered the dispatcher processing of the MVC dispatcher router, but rather your own stuff. Thus, this single script entry point will look almost identical to the web entry point, the only distinguishing feature of which is the application object instance. Then pass the name of the desired application class as a command line parameter to the script.
But here I admit I'm less confident and just throw away ideas.
Hope this helps someone. It actually helped me record all this. Thank you and welcome!
Update 2009-09-29: Just looked at this article: Using the Zend Framework from the command line
Update 2009-11-20: And another article: Cron Tasks in Zend Framework | GS design
Update 2010-02-25: Simple command line scripts with Zend Application - David Caunt