X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=public%2Findex.php;h=ece12223cf036b7a174fb54efa2d4aa0edc3f00f;hb=a090dba63f68a2d71933b40be8466bb90f572e38;hp=84f5f903796960206efe27604fb254bdecef7967;hpb=c98ce242fea38efa5abfa940202b55747fbed7a9;p=zf2.biz%2Fgalerie.git diff --git a/public/index.php b/public/index.php index 84f5f90..ece1222 100644 --- a/public/index.php +++ b/public/index.php @@ -1,30 +1,21 @@ array())); +// 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`?'); +} -$appConfig = new Zend\Config\Config(include __DIR__ . '/../configs/application.config.php'); +// Get application stack configuration +$configuration = include 'config/application.config.php'; -$moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']); -$moduleLoader->register(); +// Setup service manager +$serviceManager = new ServiceManager(new ServiceManagerConfiguration($configuration['service_manager'])); +$serviceManager->setService('ApplicationConfiguration', $configuration); +$serviceManager->get('ModuleManager')->loadModules(); -$moduleManager = new Zend\Module\Manager( - $appConfig['modules'], - new Zend\Module\ManagerOptions($appConfig['module_manager_options']) -); - -// Create application, bootstrap, and run -$bootstrap = new Zend\Mvc\Bootstrap($moduleManager); -$application = new Zend\Mvc\Application; -$bootstrap->bootstrap($application); -$application->run()->send(); +// Run application +$serviceManager->get('Application')->bootstrap()->run()->send();