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/ZendFramework/library'),
12 require_once 'Zend/Loader/AutoloaderFactory.php';
13 Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));
15 $appConfig = include __DIR__ . '/../configs/application.config.php';
17 $moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']);
18 $moduleLoader->register();
20 $moduleManager = new Zend\Module\Manager(
21 $appConfig['modules'],
22 new Zend\Module\ManagerOptions($appConfig['module_manager_options'])
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();