PageRenderTime 66ms CodeModel.GetById 19ms RepoModel.GetById 9ms app.codeStats 0ms

/cake/console/templates/skel/webroot/index.php

http://github.com/Datawalke/Coordino
PHP | 87 lines | 40 code | 2 blank | 45 comment | 16 complexity | d2d8ce0d5f3d1cfabd9e86ef7bb5d358 MD5 | raw file
  1. <?php
  2. /**
  3. * Index
  4. *
  5. * The Front Controller for handling every request
  6. *
  7. * PHP versions 4 and 5
  8. *
  9. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  10. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. *
  12. * Licensed under The MIT License
  13. * Redistributions of files must retain the above copyright notice.
  14. *
  15. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  16. * @link http://cakephp.org CakePHP(tm) Project
  17. * @package cake
  18. * @subpackage cake.app.webroot
  19. * @since CakePHP(tm) v 0.2.9
  20. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  21. */
  22. /**
  23. * Use the DS to separate the directories in other defines
  24. */
  25. if (!defined('DS')) {
  26. define('DS', DIRECTORY_SEPARATOR);
  27. }
  28. /**
  29. * These defines should only be edited if you have cake installed in
  30. * a directory layout other than the way it is distributed.
  31. * When using custom settings be sure to use the DS and do not add a trailing DS.
  32. */
  33. /**
  34. * The full path to the directory which holds "app", WITHOUT a trailing DS.
  35. *
  36. */
  37. if (!defined('ROOT')) {
  38. define('ROOT', dirname(dirname(dirname(__FILE__))));
  39. }
  40. /**
  41. * The actual directory name for the "app".
  42. *
  43. */
  44. if (!defined('APP_DIR')) {
  45. define('APP_DIR', basename(dirname(dirname(__FILE__))));
  46. }
  47. /**
  48. * The absolute path to the "cake" directory, WITHOUT a trailing DS.
  49. *
  50. */
  51. if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  52. define('CAKE_CORE_INCLUDE_PATH', ROOT);
  53. }
  54. /**
  55. * Editing below this line should NOT be necessary.
  56. * Change at your own risk.
  57. *
  58. */
  59. if (!defined('WEBROOT_DIR')) {
  60. define('WEBROOT_DIR', basename(dirname(__FILE__)));
  61. }
  62. if (!defined('WWW_ROOT')) {
  63. define('WWW_ROOT', dirname(__FILE__) . DS);
  64. }
  65. if (!defined('CORE_PATH')) {
  66. if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) {
  67. define('APP_PATH', null);
  68. define('CORE_PATH', null);
  69. } else {
  70. define('APP_PATH', ROOT . DS . APP_DIR . DS);
  71. define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
  72. }
  73. }
  74. if (php_sapi_name() == 'cli-server') {
  75. $_SERVER['PHP_SELF'] = '/'.basename(__FILE__);
  76. }
  77. if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
  78. 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);
  79. }
  80. if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
  81. return;
  82. } else {
  83. $Dispatcher = new Dispatcher();
  84. $Dispatcher->dispatch();
  85. }