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