index.php

Go to the documentation of this file.
00001 <?php
00002 /* SVN FILE: $Id: cake_2console_2libs_2templates_2skel_2webroot_2index_8php-source.html 580 2008-07-01 14:45:49Z gwoo $ */
00003 /**
00004  * Short description for file.
00005  *
00006  * Long description for file
00007  *
00008  * PHP versions 4 and 5
00009  *
00010  * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
00011  * Copyright 2005-2008, Cake Software Foundation, Inc.
00012  *                              1785 E. Sahara Avenue, Suite 490-204
00013  *                              Las Vegas, Nevada 89104
00014  *
00015  * Licensed under The MIT License
00016  * Redistributions of files must retain the above copyright notice.
00017  *
00018  * @filesource
00019  * @copyright       Copyright 2005-2008, Cake Software Foundation, Inc.
00020  * @link                http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
00021  * @package         cake
00022  * @subpackage      cake.app.webroot
00023  * @since           CakePHP(tm) v 0.2.9
00024  * @version         $Revision: 580 $
00025  * @modifiedby      $LastChangedBy: gwoo $
00026  * @lastmodified    $Date: 2008-07-01 09:45:49 -0500 (Tue, 01 Jul 2008) $
00027  * @license         http://www.opensource.org/licenses/mit-license.php The MIT License
00028  */
00029 /**
00030  * Use the DS to separate the directories in other defines
00031  */
00032     if (!defined('DS')) {
00033         define('DS', DIRECTORY_SEPARATOR);
00034     }
00035 /**
00036  * These defines should only be edited if you have cake installed in
00037  * a directory layout other than the way it is distributed.
00038  * When using custom settings be sure to use the DS and do not add a trailing DS.
00039  */
00040 
00041 /**
00042  * The full path to the directory which holds "app", WITHOUT a trailing DS.
00043  *
00044  */
00045     if (!defined('ROOT')) {
00046         define('ROOT', dirname(dirname(dirname(__FILE__))));
00047     }
00048 /**
00049  * The actual directory name for the "app".
00050  *
00051  */
00052     if (!defined('APP_DIR')) {
00053         define('APP_DIR', basename(dirname(dirname(__FILE__))));
00054     }
00055 /**
00056  * The absolute path to the "cake" directory, WITHOUT a trailing DS.
00057  *
00058  */
00059     if (!defined('CAKE_CORE_INCLUDE_PATH')) {
00060         define('CAKE_CORE_INCLUDE_PATH', ROOT);
00061     }
00062 
00063 /**
00064  * Editing below this line should not be necessary.
00065  * Change at your own risk.
00066  *
00067  */
00068     if (!defined('WEBROOT_DIR')) {
00069         define('WEBROOT_DIR', basename(dirname(__FILE__)));
00070     }
00071     if (!defined('WWW_ROOT')) {
00072         define('WWW_ROOT', dirname(__FILE__) . DS);
00073     }
00074     if (!defined('CORE_PATH')) {
00075         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'))) {
00076             define('APP_PATH', null);
00077             define('CORE_PATH', null);
00078         } else {
00079             define('APP_PATH', ROOT . DS . APP_DIR . DS);
00080             define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
00081         }
00082     }
00083     if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
00084         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);
00085     }
00086     if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
00087         return;
00088     } else {
00089         $Dispatcher = new Dispatcher();
00090         $Dispatcher->dispatch($url);
00091     }
00092     if (Configure::read() > 0) {
00093         echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
00094     }
00095 ?>