-// Define application environment
-defined('APPLICATION_ENV')
- || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
-
-// Ensure ZF is on the include path
-set_include_path(implode(PATH_SEPARATOR, array(
- realpath(__DIR__ . '/../library'),
- realpath(__DIR__ . '/../library/ZendFramework/library'),
- get_include_path(),
-)));
-
-require_once 'Zend/Loader/AutoloaderFactory.php';
+chdir(dirname(__DIR__));
+require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php';