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
 * @link          http://cakephp.org CakePHP(tm) Project
8
 * @package       app.webroot
9
 * @since         CakePHP(tm) v 0.2.9
10
 */
11
 
12
/**
13
 * Use the DS to separate the directories in other defines
14
 */
15
if (!defined('DS')) {
16
	define('DS', DIRECTORY_SEPARATOR);
17
}
18
 
19
/**
20
 * These defines should only be edited if you have CakePHP installed in
21
 * a directory layout other than the way it is distributed.
22
 * When using custom settings be sure to use the DS and do not add a trailing DS.
23
 */
24
 
25
/**
26
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
27
 *
28
 */
29
if (!defined('ROOT')) {
30
	define('ROOT', dirname(dirname(dirname(__FILE__))));
31
}
32
 
33
/**
34
 * The actual directory name for the "app".
35
 *
36
 */
37
if (!defined('APP_DIR')) {
38
	define('APP_DIR', basename(dirname(dirname(__FILE__))));
39
}
40
 
41
/**
42
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
43
 *
44
 * Un-comment this line to specify a fixed path to CakePHP.
45
 * This should point at the directory containing `Cake`.
46
 *
47
 * For ease of development CakePHP uses PHP's include_path. If you
48
 * cannot modify your include_path set this value.
49
 *
50
 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
51
 *
52
 * The following line differs from its sibling
53
 * /app/webroot/index.php
54
 */
55
//define('CAKE_CORE_INCLUDE_PATH', __CAKE_PATH__);
56
 
57
/**
58
 * This auto-detects CakePHP as a composer installed library.
59
 * You may remove this if you are not planning to use composer (not recommended, though).
60
 */
61
$vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
62
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
63
if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispatcher)) {
64
	define('CAKE_CORE_INCLUDE_PATH', $vendorPath);
65
}
66
 
67
/**
68
 * Editing below this line should NOT be necessary.
69
 * Change at your own risk.
70
 *
71
 */
72
if (!defined('WEBROOT_DIR')) {
73
	define('WEBROOT_DIR', basename(dirname(__FILE__)));
74
}
75
if (!defined('WWW_ROOT')) {
76
	define('WWW_ROOT', dirname(__FILE__) . DS);
77
}
78
 
79
// for built-in server
80
if (php_sapi_name() === 'cli-server') {
81
	if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
82
		return false;
83
	}
84
	$_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
85
}
86
 
87
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
88
	if (function_exists('ini_set')) {
89
		ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
90
	}
91
	if (!include 'Cake' . DS . 'bootstrap.php') {
92
		$failed = true;
93
	}
94
} else {
95
	if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
96
		$failed = true;
97
	}
98
}
99
if (!empty($failed)) {
100
	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);
101
}
102
 
103
App::uses('Dispatcher', 'Routing');
104
 
105
$Dispatcher = new Dispatcher();
106
$Dispatcher->dispatch(
107
	new CakeRequest(),
108
	new CakeResponse()
109
);