Zend Framework 1.2 - 按模块配置

I have some plugins in zend framework and at the same time I have an application with various modules, I would like to know how to load plugins without all run on each request.

In module admin I have a function in bootstrap file:

public function _initPlugins() {
        Zend_Controller_Front::getInstance()->registerPlugin(new Admin_Plugin_SecurityCheck());
    }

In module affiliates I have a function in bootstrap file:

public function _initPlugins() {
        Zend_Controller_Front::getInstance()->registerPlugin(new Affiliates_Plugin_SecurityCheck());
    }

I just want to load plugins and settings per module and not in all modules. How can you do this? Thank you.

You can replace standard Zend_Application_Resource_Modules resource, which load modules.

For this:

  1. Create Your_Application_Resource_ModulesCustom, which extends from Zend_Application_Resource_Modules and disable automatic call of _initPlugins for modules.
  2. When you determine, which module must be loaded, you should manually call _initPlugins for this module.