Issues

ZF-9996: Module Bootstrapper ignores Default Module setting

Description

in application.ini, module modX is set to be the default module and prefixDefaultModule parameter is turned on. However the application still looks for a class Default_Bootloader rather than modX_Bootloader.

One of the workarounds is to create a module directory 'default' with a file Bootstrap.php that will have:


class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{
}

Our scenario: Current system has 2 modules, modX and modY, with modX being the default module +for now+. Future development will lead to further development of modY and modZ, with either modY or modZ becoming the default module. Switching between the default modules has to be as "painless" as possible (translation: minimum-to-none code changes)

Comments

The attached patch (Modules.patch) is an alternate solution I've arrived at. Basically during the Module Bootstrapper selection, it checks if the current module is the one selected to be the default module and if the prefixDefaultModule parameter is enabled. If both conditions are true, it switches the current module and module directory to the default one, that is the module specified as default using the defaultModule setting.