bootstrap.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. error_reporting(E_ALL | E_STRICT);
  3. // Define path to application directory
  4. defined('APPLICATION_PATH')
  5. || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application/'));
  6. // Define path to configs directory
  7. define('CONFIG_PATH', APPLICATION_PATH . '/configs/');
  8. // Define application environment
  9. defined('APPLICATION_ENV')
  10. || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));
  11. // Ensure library/ is on include_path
  12. set_include_path(implode(PATH_SEPARATOR, array(
  13. realpath('./library'),
  14. get_include_path(),
  15. )));
  16. // Ensure library/ is on include_path
  17. set_include_path(implode(PATH_SEPARATOR, array(
  18. get_include_path(),
  19. realpath(APPLICATION_PATH . '/../library')
  20. )));
  21. set_include_path(implode(PATH_SEPARATOR, array(
  22. get_include_path(),
  23. realpath(APPLICATION_PATH . '/../library/propel/runtime/lib')
  24. )));
  25. // Ensure library/ is on include_path
  26. set_include_path(implode(PATH_SEPARATOR, array(
  27. get_include_path(),
  28. realpath(APPLICATION_PATH . '/../../install_minimal/include')
  29. )));
  30. require_once (APPLICATION_PATH."/logging/Logging.php");
  31. Logging::setLogPath('/var/log/airtime/zendphp.log');
  32. set_include_path(APPLICATION_PATH . '/common' . PATH_SEPARATOR . get_include_path());
  33. //Propel classes.
  34. set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
  35. //Services
  36. set_include_path(APPLICATION_PATH . '/services' . PATH_SEPARATOR . get_include_path());
  37. //models
  38. set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
  39. //Controllers.
  40. set_include_path(APPLICATION_PATH . '/controllers' . PATH_SEPARATOR . get_include_path());
  41. //Controller plugins.
  42. set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
  43. //test data
  44. set_include_path(APPLICATION_PATH . '/../tests/application/testdata' . PATH_SEPARATOR . get_include_path());
  45. //helper functions
  46. set_include_path(APPLICATION_PATH . '/../tests/application/helpers' . PATH_SEPARATOR . get_include_path());
  47. //Zend framework
  48. if (file_exists('/usr/share/php/libzend-framework-php')) {
  49. set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
  50. set_include_path('/usr/share/php/libzend-framework-php/Zend/Test/PHPUnit' . PATH_SEPARATOR . get_include_path());
  51. }
  52. require_once 'Zend/Application.php';
  53. require_once 'Zend/Config.php';
  54. require_once APPLICATION_PATH.'/configs/conf.php';
  55. require_once 'propel/runtime/lib/Propel.php';
  56. Propel::init("../application/configs/airtime-conf-production.php");
  57. require_once 'Zend/Session.php';
  58. Zend_Session::start();