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