I'm building a multi-site Zend Framework application using modules, sort of in the following structure:
|Project
|-Application
|-configs
|-modules
|-core
|-controllers
|-models
|-views
|-Bootstrap.php
|-site1
|-controllers
|-models
|-views
|-Bootstrap.php
|-site2
|-site3
|-Bootstrap.php
|-Docs
|-Library
|-Public
|-.zfproject.xml
Each module extends Core module.
I have the following in my module:
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
What's the best way to Boostrap /application/modules/core/bootstrap.php
and /application/modules/xxx/bootstrap.php
where 'xxx' is the name of the module being loaded?
I could do it with a check at the top of every single Bootstrap method?
Or, should I be only adding the Module for the site I'm requesting alongside Core, and thus only two Bootstrap.php files would ever be loaded?
EDIT
If I remove the resources.modules[] = ""
from my application.ini, and use the following code in my main Bootstrap.php to add a module, it appears to add the Controllers but not actually fire the Bootstrap.php located within the module?
$frontController = $this->getResource('frontController');
$frontController->addControllerDirectory(APPLICATION_PATH . '/modules/site1/controllers', 'site1');