Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15403 manish.sha 1
<?php
2
/**
3
 * Index
4
 *
5
 * The Front Controller for handling every request
6
 *
7
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
9
 *
10
 * Licensed under The MIT License
11
 * For full copyright and license information, please see the LICENSE.txt
12
 * Redistributions of files must retain the above copyright notice.
13
 *
14
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15
 * @link          http://cakephp.org CakePHP(tm) Project
16
 * @package       app.webroot
17
 * @since         CakePHP(tm) v 0.2.9
18
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
19
 */
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
/**
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
/**
35
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
36
 *
37
 */
38
if (!defined('ROOT')) {
39
	define('ROOT', dirname(dirname(dirname(__FILE__))));
40
}
41
 
42
/**
43
 * The actual directory name for the "app".
44
 *
45
 */
46
if (!defined('APP_DIR')) {
47
	define('APP_DIR', basename(dirname(dirname(__FILE__))));
48
}
49
 
50
/**
51
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
52
 *
53
 * Un-comment this line to specify a fixed path to CakePHP.
54
 * This should point at the directory containing `Cake`.
55
 *
56
 * For ease of development CakePHP uses PHP's include_path. If you
57
 * cannot modify your include_path set this value.
58
 *
59
 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
60
 *
61
 * The following line differs from its sibling
62
 * /lib/Cake/Console/Templates/skel/webroot/index.php
63
 */
64
//define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
65
 
66
/**
67
 * Editing below this line should NOT be necessary.
68
 * Change at your own risk.
69
 *
70
 */
71
if (!defined('WEBROOT_DIR')) {
72
	define('WEBROOT_DIR', basename(dirname(__FILE__)));
73
}
74
if (!defined('WWW_ROOT')) {
75
	define('WWW_ROOT', dirname(__FILE__) . DS);
76
}
77
 
78
// for built-in server
79
if (php_sapi_name() === 'cli-server') {
80
	if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
81
		return false;
82
	}
83
	$_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
84
}
85
 
86
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
87
	if (function_exists('ini_set')) {
88
		ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
89
	}
90
	if (!include 'Cake' . DS . 'bootstrap.php') {
91
		$failed = true;
92
	}
93
} else {
94
	if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
95
		$failed = true;
96
	}
97
}
98
if (!empty($failed)) {
99
	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);
100
}
101
 
102
App::uses('Dispatcher', 'Routing');
103
 
104
$Dispatcher = new Dispatcher();
105
$Dispatcher->dispatch(
106
	new CakeRequest(),
107
	new CakeResponse()
108
);