[Zend] Modules and module specific Bootstrap
Posted: Tue Apr 19, 2011 5:25 pm
I have had the module directory structure in my application folder. I have put the specific module related options in my application.ini (multilanguage support):
[text]resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = On
resources.router.routes.defaultmodule.type = Zend_Controller_Router_Route_Module
resources.router.routes.defaultmodule.abstract = On
resources.router.routes.defaultmodule.defaults.module = "default"
resources.router.routes.language.type = Zend_Controller_Router_Route
resources.router.routes.language.route = ":language"
resources.router.routes.language.reqs.language = "^(bg|en)$"
resources.router.routes.language.defaults.language = "bg"
resources.router.routes.default.type = Zend_Controller_Router_Route_Chain
resources.router.routes.default.chain = "language, defaultmodule"[/text]
I have put the Bootstrap.php (extends Zend_Application_Module_Bootstrap) files in each of my modules root directories.
I've read that even I had made this, *every* single module Bootstrap file will be executed after the application Bootstrap (very annoying).
Question: how to distinguish in my module Bootstrap files the action controller of which module is about to be executed, so I can take different actions in them?
[text]resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = On
resources.router.routes.defaultmodule.type = Zend_Controller_Router_Route_Module
resources.router.routes.defaultmodule.abstract = On
resources.router.routes.defaultmodule.defaults.module = "default"
resources.router.routes.language.type = Zend_Controller_Router_Route
resources.router.routes.language.route = ":language"
resources.router.routes.language.reqs.language = "^(bg|en)$"
resources.router.routes.language.defaults.language = "bg"
resources.router.routes.default.type = Zend_Controller_Router_Route_Chain
resources.router.routes.default.chain = "language, defaultmodule"[/text]
I have put the Bootstrap.php (extends Zend_Application_Module_Bootstrap) files in each of my modules root directories.
I've read that even I had made this, *every* single module Bootstrap file will be executed after the application Bootstrap (very annoying).
Question: how to distinguish in my module Bootstrap files the action controller of which module is about to be executed, so I can take different actions in them?