2011-06-10 21:55:32 +00:00
|
|
|
<?php
|
2012-08-04 10:40:48 +00:00
|
|
|
define('WORK_PATH', realpath(dirname(__FILE__) . '/../work'));
|
2011-06-10 21:55:32 +00:00
|
|
|
|
|
|
|
// Define path to application directory
|
|
|
|
defined('APPLICATION_PATH') || define(
|
2012-08-04 17:36:51 +00:00
|
|
|
'APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')
|
2011-06-10 21:55:32 +00:00
|
|
|
);
|
|
|
|
|
2011-06-19 21:26:17 +00:00
|
|
|
defined('LIBRARY_PATH') || define(
|
2012-08-04 17:36:51 +00:00
|
|
|
'LIBRARY_PATH', realpath(dirname(__FILE__) . '/../library')
|
2011-06-19 21:26:17 +00:00
|
|
|
);
|
|
|
|
|
2011-06-10 21:55:32 +00:00
|
|
|
// Define application environment
|
|
|
|
if (!defined('APPLICATION_ENV')) {
|
|
|
|
$appEnvironment = getenv('APPLICATION_ENV');
|
|
|
|
if ($appEnvironment !== false) {
|
|
|
|
define('APPLICATION_ENV', $appEnvironment);
|
|
|
|
} else {
|
|
|
|
define('APPLICATION_ENV', 'production');
|
|
|
|
}
|
|
|
|
unset($appEnvironment);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ensure library/ is on include_path
|
2012-08-04 17:36:51 +00:00
|
|
|
set_include_path(implode(PATH_SEPARATOR, array(LIBRARY_PATH, get_include_path())));
|
2011-06-10 21:55:32 +00:00
|
|
|
|
|
|
|
if (APPLICATION_ENV == 'development' && !class_exists('Debug')) {
|
|
|
|
include_once 'Debug.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Zend_Application */
|
|
|
|
require_once 'Zend/Application.php';
|
|
|
|
|
|
|
|
// Create application, bootstrap, and run
|
|
|
|
$application = new Zend_Application(
|
|
|
|
APPLICATION_ENV,
|
2012-08-04 10:40:48 +00:00
|
|
|
APPLICATION_PATH . '/configs/application.ini'
|
2011-06-10 21:55:32 +00:00
|
|
|
);
|
2012-08-04 17:36:51 +00:00
|
|
|
$application->bootstrap()->run();
|