ZF-11867: Module resource bootstraps default module when it's not supposed to
When I run my application using a cli.ini config file, which specifies the bootstrap options as:
bootstrap.path = APPLICATION_PATH "/CliBootstrap.php" bootstrap.class = "CliBootstrap"
Zend_Application_Resource_Modules#init() sets $bootstrapClass to "Bootstrap" (hard-coded) instead of getting this information from the config (or using $curBootstrapClass).
This results in the default module's Bootstrap being executed, when this has already been taken care of by the CliBootstrap.
One fix would be the following:
//$bootstrapClass = 'Bootstrap'; $bootstrapOptions = $this->getBootstrap()->getApplication()->getOption('bootstrap'); $bootstrapClass = $bootstrapOptions['class']; // Or $curBootstrapClass.
Although the code in this method could probably be simplified. You could probably "continue:" if $module === $default.