I am pretty familiar with Zend Framework details and how most things work. One area that I still don’t fully understand is the way Zend Framework loads resources from application.ini.
I understand I can create my own protected _init functions and these will be called automatically during bootstrap.
The Zend Framework documentation is lacking in certain areas.
For example: How and when does the resources.db config options get loaded? I have nothing in my bootstrap that talks about db. Does this get loaded on demand or actually during the bootstrap process?
Any links of references explaining this would be very helpful.
Your bootstrap class ultimately inherits from
Zend_Application_Bootstrap_BootstrapAbstract. Thebootstrap()method in this class first searches for class methods prefixed with_init, and runs these. It then looks for resource plugins, which are populated by the ‘resources’ part of the options array. The options array comes from the configuration passed to Zend Application, which usually comes from application.ini.Resource plugins map to a class on the file system. So
resources.dbby default will create an instance ofZend_Application_Resource_Dband run it (which in turns sets up the relevant db stuff). There is a full list of the built in resources here: http://framework.zend.com/manual/en/zend.application.available-resources.htmlAll your application resources are run during the bootstrap process, unless you’ve told the bootstrap to init only specific ones.
There is a reasonably detailed overview of how it all fits together in the docs: http://framework.zend.com/manual/en/zend.application.theory-of-operation.html, but it’s the kind of thing that you don’t really need to know the details of unless your requirements are a little custom.