X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=public%2Findex.php;h=60730da5372373d877e84461c51e31d4d63056c7;hb=491bd52235289a2eeddc865797b338b95e6269be;hp=edf3990be787f42da1173a3905468e599e445392;hpb=b38a3586fd6b4b73640daf12ed4222d246823ff0;p=zf2.biz%2Fapplication_blanche.git diff --git a/public/index.php b/public/index.php index edf3990..60730da 100644 --- a/public/index.php +++ b/public/index.php @@ -1,29 +1,20 @@ array())); -$appConfig = include __DIR__ . '/../configs/application.config.php'; +$appConfig = include 'config/application.config.php'; -$moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']); -$moduleLoader->register(); +$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']); +$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions); +$defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php'); -$moduleManager = new Zend\Module\Manager( - $appConfig['modules'], - new Zend\Module\ManagerOptions($appConfig['module_manager_options']) -); +$moduleManager = new Zend\Module\Manager($appConfig['modules']); +$moduleManager->events()->attachAggregate($defaultListeners); +$moduleManager->loadModules(); // Create application, bootstrap, and run -$bootstrap = new Zend\Mvc\Bootstrap($moduleManager); -$application = new Zend\Mvc\Application; +$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig()); +$application = new Zend\Mvc\Application; $bootstrap->bootstrap($application); $application->run()->send();