
Untitled
By: a guest on
May 12th, 2012 | syntax:
None | size: 1.18 KB | hits: 13 | expires: Never
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// @todo Find better way to handle CLI environment detection.
if(file_exists(APPLICATION_PATH . '/../production.php')) {
define('APPLICATION_ENV', 'production');
} else {
define('APPLICATION_ENV', 'development');
}
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
// Initialize Zend class autoloading
require_once 'Zend/Loader/Autoloader.php';
$Loader = Zend_Loader_Autoloader::getInstance();
$Loader->isFallbackAutoloader();
// Register custom namespaces
$Loader->registerNamespace( 'Doctrine' );
$Loader->registerNamespace( 'Site' );
// Create application and bootstrap
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.xml'
);
$application->getBootstrap()->bootstrap();