PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/Cake/Console/Templates/skel/webroot/index.php

https://bitbucket.org/udeshika/fake_twitter
PHP | 98 lines | 37 code | 9 blank | 52 comment | 14 complexity | f03104a7da63fa54d58c07b447bd2669 MD5 | raw file
  1. <?php
  2. /**
  3. * Index
  4. *
  5. * The Front Controller for handling every request
  6. *
  7. * PHP 5
  8. *
  9. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  10. * Copyright 2005-2011, 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-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  16. * @link http://cakephp.org CakePHP(tm) Project
  17. * @package app.webroot
  18. * @since CakePHP(tm) v 0.2.9
  19. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  20. */
  21. /**
  22. * Use the DS to separate the directories in other defines
  23. */
  24. if (!defined('DS')) {
  25. define('DS', DIRECTORY_SEPARATOR);
  26. }
  27. /**
  28. * These defines should only be edited if you have cake installed in
  29. * a directory layout other than the way it is distributed.
  30. * When using custom settings be sure to use the DS and do not add a trailing DS.
  31. */
  32. /**
  33. * The full path to the directory which holds "app", WITHOUT a trailing DS.
  34. *
  35. */
  36. if (!defined('ROOT')) {
  37. define('ROOT', dirname(dirname(dirname(__FILE__))));
  38. }
  39. /**
  40. * The actual directory name for the "app".
  41. *
  42. */
  43. if (!defined('APP_DIR')) {
  44. define('APP_DIR', basename(dirname(dirname(__FILE__))));
  45. }
  46. /**
  47. * The absolute path to the "cake" directory, WITHOUT a trailing DS.
  48. *
  49. * Un-comment this line to specify a fixed path to CakePHP.
  50. * This should point at the directory containing `Cake`.
  51. *
  52. * For ease of development CakePHP uses PHP's include_path. If you
  53. * cannot modify your include_path set this value.
  54. *
  55. * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
  56. */
  57. //define('CAKE_CORE_INCLUDE_PATH', __CAKE_PATH__);
  58. /**
  59. * Editing below this line should NOT be necessary.
  60. * Change at your own risk.
  61. *
  62. */
  63. if (!defined('WEBROOT_DIR')) {
  64. define('WEBROOT_DIR', basename(dirname(__FILE__)));
  65. }
  66. if (!defined('WWW_ROOT')) {
  67. define('WWW_ROOT', dirname(__FILE__) . DS);
  68. }
  69. if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  70. if (function_exists('ini_set')) {
  71. ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
  72. }
  73. if (!include('Cake' . DS . 'bootstrap.php')) {
  74. $failed = true;
  75. }
  76. } else {
  77. if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
  78. $failed = true;
  79. }
  80. }
  81. if (!empty($failed)) {
  82. 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);
  83. }
  84. if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') {
  85. return;
  86. }
  87. App::uses('Dispatcher', 'Routing');
  88. $Dispatcher = new Dispatcher();
  89. $Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));