Base for a static organization website

index.php 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /**
  3. * The Front Controller for handling every request
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @package app.webroot
  15. * @since CakePHP(tm) v 0.2.9
  16. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  17. */
  18. /**
  19. * Use the DS to separate the directories in other defines
  20. */
  21. if (!defined('DS')) {
  22. define('DS', DIRECTORY_SEPARATOR);
  23. }
  24. /**
  25. * These defines should only be edited if you have CakePHP installed in
  26. * a directory layout other than the way it is distributed.
  27. * When using custom settings be sure to use the DS and do not add a trailing DS.
  28. */
  29. /**
  30. * The full path to the directory which holds "app", WITHOUT a trailing DS.
  31. */
  32. if (!defined('ROOT')) {
  33. define('ROOT', dirname(dirname(dirname(__FILE__))));
  34. }
  35. /**
  36. * The actual directory name for the "app".
  37. */
  38. if (!defined('APP_DIR')) {
  39. define('APP_DIR', basename(dirname(dirname(__FILE__))));
  40. }
  41. /**
  42. * The absolute path to the "cake" directory, WITHOUT a trailing DS.
  43. *
  44. * Un-comment this line to specify a fixed path to CakePHP.
  45. * This should point at the directory containing `Cake`.
  46. *
  47. * For ease of development CakePHP uses PHP's include_path. If you
  48. * cannot modify your include_path set this value.
  49. *
  50. * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
  51. *
  52. * The following line differs from its sibling
  53. * /app/webroot/index.php
  54. */
  55. define('CAKE_CORE_INCLUDE_PATH', DS . 'home' . DS . 'kod3' . DS . 'work' . DS . 'vitrine' . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');
  56. /**
  57. * This auto-detects CakePHP as a composer installed library.
  58. * You may remove this if you are not planning to use composer (not recommended, though).
  59. */
  60. $vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
  61. $dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
  62. if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispatcher)) {
  63. define('CAKE_CORE_INCLUDE_PATH', $vendorPath);
  64. }
  65. /**
  66. * Editing below this line should NOT be necessary.
  67. * Change at your own risk.
  68. */
  69. if (!defined('WEBROOT_DIR')) {
  70. define('WEBROOT_DIR', basename(dirname(__FILE__)));
  71. }
  72. if (!defined('WWW_ROOT')) {
  73. define('WWW_ROOT', dirname(__FILE__) . DS);
  74. }
  75. // For the built-in server
  76. if (PHP_SAPI === 'cli-server') {
  77. if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
  78. return false;
  79. }
  80. $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
  81. }
  82. if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  83. if (function_exists('ini_set')) {
  84. ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
  85. }
  86. if (!include 'Cake' . DS . 'bootstrap.php') {
  87. $failed = true;
  88. }
  89. } elseif (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
  90. $failed = true;
  91. }
  92. if (!empty($failed)) {
  93. trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
  94. }
  95. App::uses('Dispatcher', 'Routing');
  96. $Dispatcher = new Dispatcher();
  97. $Dispatcher->dispatch(
  98. new CakeRequest(),
  99. new CakeResponse()
  100. );