bootstrap.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * Basic Cake functionality.
  5. *
  6. * Core functions for including other source files, loading models and so forth.
  7. *
  8. * PHP versions 4 and 5
  9. *
  10. * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
  11. * Copyright 2005-2007, Cake Software Foundation, Inc.
  12. * 1785 E. Sahara Avenue, Suite 490-204
  13. * Las Vegas, Nevada 89104
  14. *
  15. * Licensed under The MIT License
  16. * Redistributions of files must retain the above copyright notice.
  17. *
  18. * @filesource
  19. * @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
  20. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
  21. * @package cake
  22. * @subpackage cake.cake
  23. * @since CakePHP(tm) v 0.2.9
  24. * @version $Revision$
  25. * @modifiedby $LastChangedBy$
  26. * @lastmodified $Date$
  27. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  28. */
  29. if (!defined('PHP5')) {
  30. define ('PHP5', (phpversion() >= 5));
  31. }
  32. /**
  33. * Configuration, directory layout and standard libraries
  34. */
  35. if (!isset($bootstrap)) {
  36. require CORE_PATH . 'cake' . DS . 'basics.php';
  37. $TIME_START = getMicrotime();
  38. require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
  39. require LIBS . 'object.php';
  40. require LIBS . 'inflector.php';
  41. require LIBS . 'configure.php';
  42. }
  43. require APP_PATH . 'config' . DS . 'core.php';
  44. require LIBS . 'cache.php';
  45. require LIBS . 'session.php';
  46. require LIBS . 'security.php';
  47. if (isset($cakeCache)) {
  48. $cache = 'File';
  49. $settings = array();
  50. if (isset($cakeCache[0])) {
  51. $cache = $cakeCache[0];
  52. }
  53. if (isset($cakeCache[1])) {
  54. $settings = $cakeCache[1];
  55. }
  56. Cache::engine($cache, $settings);
  57. } else {
  58. Cache::engine();
  59. }
  60. Configure::store(null, 'class.paths');
  61. Configure::load('class.paths');
  62. if (defined('DEBUG')) {
  63. Configure::write('debug', DEBUG);
  64. }
  65. /**
  66. * Check for IIS Server
  67. */
  68. if (!defined('SERVER_IIS') && php_sapi_name() == 'isapi') {
  69. define('SERVER_IIS', true);
  70. }
  71. $url = null;
  72. require CAKE . 'dispatcher.php';
  73. ?>