root/trunk/app/webroot/index.php

Revision 925, 2.9 kB (checked in by arturo, 6 days ago)

Index New

Line 
1<?php
2/* SVN FILE: $Id: index.php 7296 2008-06-27 09:09:03Z gwoo $ */
3/**
4 * Short description for file.
5 *
6 * Long description for file
7 *
8 * PHP versions 4 and 5
9 *
10 * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
11 * Copyright 2005-2008, 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-2008, Cake Software Foundation, Inc.
20 * @link                http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
21 * @package         cake
22 * @subpackage      cake.app.webroot
23 * @since           CakePHP(tm) v 0.2.9
24 * @version         $Revision: 7296 $
25 * @modifiedby      $LastChangedBy: gwoo $
26 * @lastmodified    $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
27 * @license         http://www.opensource.org/licenses/mit-license.php The MIT License
28 */
29/**
30 * Use the DS to separate the directories in other defines
31 */
32    if (!defined('DS')) {
33        define('DS', DIRECTORY_SEPARATOR);
34    }
35/**
36 * These defines should only be edited if you have cake installed in
37 * a directory layout other than the way it is distributed.
38 * When using custom settings be sure to use the DS and do not add a trailing DS.
39 */
40
41/**
42 * The full path to the directory which holds "app", WITHOUT a trailing DS.
43 *
44 */
45    if (!defined('ROOT')) {
46        define('ROOT', dirname(dirname(dirname(__FILE__))));
47    }
48/**
49 * The actual directory name for the "app".
50 *
51 */
52    if (!defined('APP_DIR')) {
53        define('APP_DIR', basename(dirname(dirname(__FILE__))));
54    }
55/**
56 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
57 *
58 */
59    if (!defined('CAKE_CORE_INCLUDE_PATH')) {
60        define('CAKE_CORE_INCLUDE_PATH', ROOT);
61    }
62
63/**
64 * Editing below this line should NOT be necessary.
65 * Change at your own risk.
66 *
67 */
68    if (!defined('WEBROOT_DIR')) {
69        define('WEBROOT_DIR', basename(dirname(__FILE__)));
70    }
71    if (!defined('WWW_ROOT')) {
72        define('WWW_ROOT', dirname(__FILE__) . DS);
73    }
74    if (!defined('CORE_PATH')) {
75        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'))) {
76            define('APP_PATH', null);
77            define('CORE_PATH', null);
78        } else {
79            define('APP_PATH', ROOT . DS . APP_DIR . DS);
80            define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
81        }
82    }
83    if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
84        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);
85    }
86    if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
87        return;
88    } else {
89        $Dispatcher = new Dispatcher();
90        $Dispatcher->dispatch($url);
91    }
92    if (Configure::read() > 0) {
93        echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
94    }
95?>
Note: See TracBrowser for help on using the browser.