X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=public%2Findex.php;h=ece12223cf036b7a174fb54efa2d4aa0edc3f00f;hb=a090dba63f68a2d71933b40be8466bb90f572e38;hp=60730da5372373d877e84461c51e31d4d63056c7;hpb=491bd52235289a2eeddc865797b338b95e6269be;p=zf2.biz%2Fgalerie.git diff --git a/public/index.php b/public/index.php index 60730da..ece1222 100644 --- a/public/index.php +++ b/public/index.php @@ -1,20 +1,21 @@ array())); -$appConfig = include 'config/application.config.php'; +// Composer autoloading +if (!include_once('vendor/autoload.php')) { + throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?'); +} -$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 application stack configuration +$configuration = include 'config/application.config.php'; -$moduleManager = new Zend\Module\Manager($appConfig['modules']); -$moduleManager->events()->attachAggregate($defaultListeners); -$moduleManager->loadModules(); +// Setup service manager +$serviceManager = new ServiceManager(new ServiceManagerConfiguration($configuration['service_manager'])); +$serviceManager->setService('ApplicationConfiguration', $configuration); +$serviceManager->get('ModuleManager')->loadModules(); -// Create application, bootstrap, and run -$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig()); -$application = new Zend\Mvc\Application; -$bootstrap->bootstrap($application); -$application->run()->send(); +// Run application +$serviceManager->get('Application')->bootstrap()->run()->send();