I am trying to find the best way to implement Model using Zend Framework for an enterprise application. From different articles I am now convinced that a Service Layer is a very good idea. I see that one of the arguments in favor of Service Layer is that – it can be called from outside – like from crons, SOAP, command line tasks and Queues.
But I am not clear how it can do so. When services are called from outside the Bootstrap will not run hence the model will have no information about the DB, Mail Transport, Logging etc.
Any suggestions?
We’re using a simple
init.inc.phpscript that we include in our command line scripts and cronjob scripts, which bootstrap the resources that we need:$resourcesarray is the bootstrap functions you wish to loadAPPLICATION_ENVis usually a variable set by.htaccess, so you’ll have to set it a shell variable (or just include it in theinit.inc.php)