Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 1.18 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. // Define path to application directory
  3. defined('APPLICATION_PATH')
  4.     || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  5.  
  6. // @todo Find better way to handle CLI environment detection.
  7. if(file_exists(APPLICATION_PATH . '/../production.php')) {
  8.     define('APPLICATION_ENV', 'production');
  9. } else {
  10.     define('APPLICATION_ENV', 'development');
  11. }
  12.  
  13. // Define application environment
  14. defined('APPLICATION_ENV')
  15.     || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  16.  
  17. // Ensure library/ is on include_path
  18. set_include_path(implode(PATH_SEPARATOR, array(
  19.     realpath(APPLICATION_PATH . '/../library'),
  20.     get_include_path(),
  21. )));
  22.  
  23. // Initialize Zend class autoloading
  24. require_once 'Zend/Loader/Autoloader.php';
  25. $Loader = Zend_Loader_Autoloader::getInstance();
  26. $Loader->isFallbackAutoloader();
  27.  
  28. // Register custom namespaces
  29. $Loader->registerNamespace( 'Doctrine' );
  30. $Loader->registerNamespace( 'Site' );
  31.  
  32. // Create application and bootstrap
  33. $application = new Zend_Application(
  34.     APPLICATION_ENV,
  35.     APPLICATION_PATH . '/configs/application.xml'
  36. );
  37. $application->getBootstrap()->bootstrap();