diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Modules.php --- a/web/lib/Zend/Application/Resource/Modules.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Modules.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Modules.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Modules.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Modules extends Zend_Application_Resource_ResourceAbstract @@ -62,6 +62,7 @@ */ public function init() { + $bootstraps = array(); $bootstrap = $this->getBootstrap(); $bootstrap->bootstrap('FrontController'); $front = $bootstrap->getResource('FrontController'); @@ -103,12 +104,28 @@ continue; } + $bootstraps[$module] = $bootstrapClass; + } + + return $this->_bootstraps = $this->bootstrapBootstraps($bootstraps); + } + + /* + * Bootstraps the bootstraps found. Allows for easy extension. + * @param array $bootstraps Array containing the bootstraps to instantiate + */ + protected function bootstrapBootstraps($bootstraps) + { + $bootstrap = $this->getBootstrap(); + $out = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); + + foreach($bootstraps as $module => $bootstrapClass) { $moduleBootstrap = new $bootstrapClass($bootstrap); $moduleBootstrap->bootstrap(); - $this->_bootstraps[$module] = $moduleBootstrap; + $out[$module] = $moduleBootstrap; } - return $this->_bootstraps; + return $out; } /**