Flexer
Flexer

Reputation: 131

Stop module bootstrap execution

Ive got 2 modules (Web, Admin) with a special boostrap class for every module.

Abstract example:

class Admin_Bootstrap extends Zend_Application_Module_Bootstrap{
protected function _initAdminHello(){
    echo "Hello from Admin";
}}


class Web_Bootstrap extends Zend_Application_Module_Bootstrap{
protected function _initWebHello(){
    echo "Hello from Web";
}}

When i call "http://example.com/web" it shows:

"Hello from Web"

"Hello from Admin"

Question: How can I stop all method executions in "Admin_Bootstrap" when the web module is called and vice versa?

This is a performance killer.

Upvotes: 2

Views: 144

Answers (1)

David Weinraub
David Weinraub

Reputation: 14184

Unfortunately, you can't. As Matthew Weier O'Phinney explains in this post, module bootstrap is for preparing resources that may be required, especially adding routes to the router and configuring namespaces and autoloaders to access resources in the module.

If there are tasks you need to perform only when the module is the one requested in the url, then these should go in a front controller plugin.

Upvotes: 3

Related Questions