1
|
<?php
|
2
|
/* SVN FILE: $Id: bootstrap.php 4409 2007-02-02 13:20:59Z phpnut $ */
|
3
|
/**
|
4
|
* Basic Cake functionality.
|
5
|
*
|
6
|
* Core functions for including other source files, loading models and so forth.
|
7
|
*
|
8
|
* PHP versions 4 and 5
|
9
|
*
|
10
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
11
|
* Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc.
|
20
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
21
|
* @package cake
|
22
|
* @subpackage cake.cake
|
23
|
* @since CakePHP(tm) v 0.2.9
|
24
|
* @version $Revision: 4409 $
|
25
|
* @modifiedby $LastChangedBy: phpnut $
|
26
|
* @lastmodified $Date: 2007-02-02 07:20:59 -0600 (Fri, 02 Feb 2007) $
|
27
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
28
|
*/
|
29
|
/**
|
30
|
* Configuration, directory layout and standard libraries
|
31
|
*/
|
32
|
if (!isset($bootstrap)) {
|
33
|
require CORE_PATH . 'cake' . DS . 'basics.php';
|
34
|
require APP_PATH . 'config' . DS . 'core.php';
|
35
|
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
|
36
|
}
|
37
|
$TIME_START = getMicrotime();
|
38
|
require LIBS . 'object.php';
|
39
|
require LIBS . 'session.php';
|
40
|
require LIBS . 'security.php';
|
41
|
require LIBS . 'inflector.php';
|
42
|
require LIBS . 'configure.php';
|
43
|
$paths = Configure::getInstance();
|
44
|
/**
|
45
|
* Enter description here...
|
46
|
*/
|
47
|
if (empty($uri) && defined('BASE_URL')) {
|
48
|
$uri = setUri();
|
49
|
|
50
|
if ($uri === '/' || $uri === '/index.php' || $uri === '/app/') {
|
51
|
$_GET['url'] = '/';
|
52
|
$url = '/';
|
53
|
} else {
|
54
|
if (strpos($uri, 'index.php') !== false) {
|
55
|
$uri = r('?', '', $uri);
|
56
|
$elements=explode('/index.php', $uri);
|
57
|
} else {
|
58
|
$elements = explode('/?', $uri);
|
59
|
}
|
60
|
|
61
|
if (!empty($elements[1])) {
|
62
|
$_GET['url'] = $elements[1];
|
63
|
$url = $elements[1];
|
64
|
} else {
|
65
|
$_GET['url'] = '/';
|
66
|
$url = '/';
|
67
|
}
|
68
|
}
|
69
|
} else {
|
70
|
if (empty($_GET['url'])) {
|
71
|
$url = null;
|
72
|
} else {
|
73
|
$url = $_GET['url'];
|
74
|
}
|
75
|
}
|
76
|
|
77
|
if (strpos($url, 'ccss/') === 0) {
|
78
|
include WWW_ROOT . DS . 'css.php';
|
79
|
die();
|
80
|
}
|
81
|
|
82
|
Configure::write('debug', DEBUG);
|
83
|
|
84
|
require CAKE . 'dispatcher.php';
|
85
|
|
86
|
if (defined('CACHE_CHECK') && CACHE_CHECK === true) {
|
87
|
if (empty($uri)) {
|
88
|
$uri = setUri();
|
89
|
}
|
90
|
$filename=CACHE . 'views' . DS . convertSlash($uri) . '.php';
|
91
|
|
92
|
if (file_exists($filename)) {
|
93
|
uses(DS . 'controller' . DS . 'component', DS . 'view' . DS . 'view');
|
94
|
$v = null;
|
95
|
$view = new View($v);
|
96
|
$view->renderCache($filename, $TIME_START);
|
97
|
} elseif(file_exists(CACHE . 'views' . DS . convertSlash($uri) . '_index.php')) {
|
98
|
uses(DS . 'controller' . DS . 'component', DS . 'view' . DS . 'view');
|
99
|
$v = null;
|
100
|
$view = new View($v);
|
101
|
$view->renderCache(CACHE . 'views' . DS . convertSlash($uri) . '_index.php', $TIME_START);
|
102
|
}
|
103
|
}
|
104
|
?>
|