edf3990be787f42da1173a3905468e599e445392
[zf2.biz/galerie.git] / public / index.php
1 <?php
2 // Define application environment
3 defined('APPLICATION_ENV')
4     || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
5
6 // Ensure ZF is on the include path
7 set_include_path(implode(PATH_SEPARATOR, array(
8     realpath(__DIR__ . '/../library/ZendFramework/library'),
9     get_include_path(),
10 )));
11
12 require_once 'Zend/Loader/AutoloaderFactory.php';
13 Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));
14
15 $appConfig = include __DIR__ . '/../configs/application.config.php';
16
17 $moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']);
18 $moduleLoader->register();
19
20 $moduleManager = new Zend\Module\Manager(
21     $appConfig['modules'],
22     new Zend\Module\ManagerOptions($appConfig['module_manager_options'])
23 );
24
25 // Create application, bootstrap, and run
26 $bootstrap      = new Zend\Mvc\Bootstrap($moduleManager);
27 $application    = new Zend\Mvc\Application;
28 $bootstrap->bootstrap($application);
29 $application->run()->send();