X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=public%2Findex.php;h=2868a5ca003f1e4ce26e66eed6fdb262d3cd75a7;hb=b2745188a1e20b47a37350018dd2bf7c0d14c3c5;hp=6c1ddb7b91c704ffc62556b9deb67ad02e6411e5;hpb=76eb64754b795c5062373988a19cfdd46a47a4a7;p=zf2.biz%2Fgalerie.git diff --git a/public/index.php b/public/index.php index 6c1ddb7..2868a5c 100644 --- a/public/index.php +++ b/public/index.php @@ -1,25 +1,21 @@ getConfigListener()->addConfigGlobPath("config/autoload/*.php"); - +// setup autoloader +AutoloaderFactory::factory(); -$moduleManager = new Zend\Module\Manager($appConfig['modules']); -$events = $moduleManager->events(); -$events->setSharedCollections($sharedEvents); -$events->attach($defaultListeners); -$moduleManager->loadModules(); +// get application stack configuration +$configuration = include 'config/application.config.php'; -// Create application, bootstrap, and run -$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig()); -$bootstrap->events()->setSharedCollections($sharedEvents); -$application = new Zend\Mvc\Application; -$bootstrap->bootstrap($application); -$application->run()->send(); +// setup service manager +$serviceManager = new ServiceManager(new ServiceManagerConfiguration($configuration['service_manager'])); +$serviceManager->setService('ApplicationConfiguration', $configuration); +$serviceManager->get('ModuleManager')->loadModules(); + +// run application +$serviceManager->get('Application')->bootstrap()->run()->send();