Many components have plugins, which allow you to create your own classes to utilize with the component, as well as to override existing, standard plugins shipped with Zend Framework. This provides important flexibility to the framework, but at a price: plugin loading is a fairly expensive task.
The plugin loader allows you to register class prefix / path pairs, allowing you to specify class files in non-standard paths. Each prefix can have multiple paths associated with it. Internally, the plugin loader loops through each prefix, and then through each path attached to it, testing to see if the file exists and is readable on that path. It then loads it, and tests to see that the class it is looking for is available. As you might imagine, this can lead to many stat calls on the file system.
Multiply this by the number of components that use the PluginLoader, and you get an idea of the scope of this issue. At the time of this writing, the following components made use of the PluginLoader:
Zend_Controller_Action_HelperBroker: helpersZend_Dojo: view helpers, form elements and decoratorsZend_File_Transfer: adaptersZend_Filter_Inflector: filters (used by the ViewRenderer action helper andZend_Layout)Zend_Filter_Input: filters and validatorsZend_Form: elements, validators, filters, decorators, captcha and file transfer adaptersZend_Paginator: adaptersZend_View: helpers, filters
How can you reduce the number of such calls made?
Zend Framework 1.7.0 adds an include file cache to the
PluginLoader. This functionality writes "include_once()"
calls to a file, which you can then include in your bootstrap. While this
introduces extra include_once() calls to your code, it
also ensures that the PluginLoader returns as early as possible.
The PluginLoader documentation includes a complete example of its use.




