I haven't seen this Globals.php but it sounds something similar to what I use myself. To simplify access to those resources I created a wrapper around Zend_Registry, which handles lazy loading and returns preconfigured components. So all it takes is one line Foo::db()->fetchAll(...) to run some sql. And this works across multiple applications, web scripts and cron jobs. I think it's pretty good solution and it proved itself in many applications I built.
Cheers swilhelm wrote: > > I have been Reading Cal Evan's Guide to Zend Framework Programming. > > In it he describes a Globals.php file for creating a single class to > encapsulate access to global resources like the database connection, cache > connection, config, etc. > > This seems useful, particularly if you use it in conjunction with his > Controller_Request_Cli class for exposing some of your Zend-based > application via command line or cron jobs. > > I was wondering if this is the recommended approach to exposing global > resources or is there a Zend Framework "approved" method? > > - Steve W. > -- View this message in context: http://www.nabble.com/Is-Cal-Evan%27s-Globals.php-a-recommended-approach-tp21379960p21381302.html Sent from the Zend Framework mailing list archive at Nabble.com.