-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
199 lines (163 loc) · 9.38 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
/**
* Fuel is a fast, lightweight, community driven PHP5 framework.
*
* @package Fuel
* @version 1.0
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2011 Fuel Development Team
* @link http://fuelphp.com
*/
define('DS', DIRECTORY_SEPARATOR);
define('CRLF', chr(13).chr(10));
setup_autoloader();
// Load the base functions
require COREPATH.'base.php';
/**
* Do we have access to mbstring?
* We need this in order to work with UTF-8 strings
*/
define('MBSTRING', function_exists('mb_get_info'));
/**
* Is mbstring enabled?
* Set the encoding to use whatever Fuel is set to use.
*/
MBSTRING and mb_internal_encoding(Fuel::$encoding);
// Is Fuel running on the command line?
Fuel::$is_cli = (bool) defined('STDIN');
/**
* Register all the error/shutdown handlers
*/
register_shutdown_function(function ()
{
return \Error::shutdown_handler();
});
set_exception_handler(function (\Exception $e)
{
return \Error::exception_handler($e);
});
set_error_handler(function ($severity, $message, $filepath, $line)
{
return \Error::error_handler($severity, $message, $filepath, $line);
});
function setup_autoloader()
{
// Load in the Autoloader
require COREPATH.'classes'.DS.'autoloader.php';
// Register the autoloader
Autoloader::register();
Autoloader::add_namespace('Fuel\\Core', COREPATH.'classes/');
Autoloader::add_classes(array(
'Fuel\\Core\\Agent' => COREPATH.'classes/agent.php',
'Fuel\\Core\\Arr' => COREPATH.'classes/arr.php',
'Fuel\\Core\\Asset' => COREPATH.'classes/asset.php',
'Fuel\\Core\\Cache' => COREPATH.'classes/cache.php',
'Fuel\\Core\\CacheNotFoundException' => COREPATH.'classes/cache.php',
'Fuel\\Core\\CacheExpiredException' => COREPATH.'classes/cache.php',
'Fuel\\Core\\Cache_Handler_Driver' => COREPATH.'classes/cache/handler/driver.php',
'Fuel\\Core\\Cache_Handler_Json' => COREPATH.'classes/cache/handler/json.php',
'Fuel\\Core\\Cache_Handler_Serialized' => COREPATH.'classes/cache/handler/serialized.php',
'Fuel\\Core\\Cache_Handler_String' => COREPATH.'classes/cache/handler/string.php',
'Fuel\\Core\\Cache_Storage_Driver' => COREPATH.'classes/cache/storage/driver.php',
'Fuel\\Core\\Cache_Storage_File' => COREPATH.'classes/cache/storage/file.php',
'Fuel\\Core\\Cache_Storage_Memcached' => COREPATH.'classes/cache/storage/memcached.php',
'Fuel\\Core\\Cache_Storage_Redis' => COREPATH.'classes/cache/storage/redis.php',
'Fuel\\Core\\Config' => COREPATH.'classes/config.php',
'Fuel\\Core\\Controller' => COREPATH.'classes/controller.php',
'Fuel\\Core\\Controller_Rest' => COREPATH.'classes/controller/rest.php',
'Fuel\\Core\\Controller_Template' => COREPATH.'classes/controller/template.php',
'Fuel\\Core\\Cookie' => COREPATH.'classes/cookie.php',
'Fuel\\Core\\DB' => COREPATH.'classes/db.php',
'Fuel\\Core\\DBUtil' => COREPATH.'classes/dbutil.php',
'Fuel\\Core\\Database_Connection' => COREPATH.'classes/database/connection.php',
'Fuel\\Core\\Database_Exception' => COREPATH.'classes/database/exception.php',
'Fuel\\Core\\Database_Expression' => COREPATH.'classes/database/expression.php',
'Fuel\\Core\\Database_Pdo_Connection' => COREPATH.'classes/database/pdo/connection.php',
'Fuel\\Core\\Database_Query' => COREPATH.'classes/database/query.php',
'Fuel\\Core\\Database_Query_Builder' => COREPATH.'classes/database/query/builder.php',
'Fuel\\Core\\Database_Query_Builder_Insert' => COREPATH.'classes/database/query/builder/insert.php',
'Fuel\\Core\\Database_Query_Builder_Delete' => COREPATH.'classes/database/query/builder/delete.php',
'Fuel\\Core\\Database_Query_Builder_Update' => COREPATH.'classes/database/query/builder/update.php',
'Fuel\\Core\\Database_Query_Builder_Select' => COREPATH.'classes/database/query/builder/select.php',
'Fuel\\Core\\Database_Query_Builder_Where' => COREPATH.'classes/database/query/builder/where.php',
'Fuel\\Core\\Database_Query_Builder_Join' => COREPATH.'classes/database/query/builder/join.php',
'Fuel\\Core\\Database_Result' => COREPATH.'classes/database/result.php',
'Fuel\\Core\\Database_Result_Cached' => COREPATH.'classes/database/result/cached.php',
'Fuel\\Core\\Database_Mysql_Connection' => COREPATH.'classes/database/mysql/connection.php',
'Fuel\\Core\\Database_MySQL_Result' => COREPATH.'classes/database/mysql/result.php',
'Fuel\\Core\\Database_Mysqli_Connection' => COREPATH.'classes/database/mysqli/connection.php',
'Fuel\\Core\\Database_MySQLi_Result' => COREPATH.'classes/database/mysqli/result.php',
'Fuel\\Core\\Fuel' => COREPATH.'classes/fuel.php',
'Fuel\\Core\\Fuel_Exception' => COREPATH.'classes/fuel.php',
'Fuel\\Core\\Date' => COREPATH.'classes/date.php',
'Fuel\\Core\\Debug' => COREPATH.'classes/debug.php',
'Fuel\\Core\\Cli' => COREPATH.'classes/cli.php',
'Fuel\\Core\\Crypt' => COREPATH.'classes/crypt.php',
'Fuel\\Core\\Event' => COREPATH.'classes/event.php',
'Fuel\\Core\\Error' => COREPATH.'classes/error.php',
'Fuel\\Core\\Format' => COREPATH.'classes/format.php',
'Fuel\\Core\\Fieldset' => COREPATH.'classes/fieldset.php',
'Fuel\\Core\\Fieldset_Field' => COREPATH.'classes/fieldset/field.php',
'Fuel\\Core\\File' => COREPATH.'classes/file.php',
'Fuel\\Core\\FileAccessException' => COREPATH.'classes/file.php',
'Fuel\\Core\\OutsideAreaException' => COREPATH.'classes/file.php',
'Fuel\\Core\\InvalidPathException' => COREPATH.'classes/file.php',
'Fuel\\Core\\File_Area' => COREPATH.'classes/file/area.php',
'Fuel\\Core\\File_Handler_File' => COREPATH.'classes/file/handler/file.php',
'Fuel\\Core\\File_Handler_Directory' => COREPATH.'classes/file/handler/directory.php',
'Fuel\\Core\\Form' => COREPATH.'classes/form.php',
'Fuel\\Core\\Ftp' => COREPATH.'classes/ftp.php',
'Fuel\\Core\\FtpConnectionException' => COREPATH.'classes/ftp.php',
'Fuel\\Core\\FtpFileAccessException' => COREPATH.'classes/ftp.php',
'Fuel\\Core\\Html' => COREPATH.'classes/html.php',
'Fuel\\Core\\Image' => COREPATH.'classes/image.php',
'Fuel\\Core\\Image_Driver' => COREPATH.'classes/image/driver.php',
'Fuel\\Core\\Image_Gd' => COREPATH.'classes/image/gd.php',
'Fuel\\Core\\Image_Imagemagick' => COREPATH.'classes/image/imagemagick.php',
'Fuel\\Core\\Image_Imagick' => COREPATH.'classes/image/imagick.php',
'Fuel\\Core\\Inflector' => COREPATH.'classes/inflector.php',
'Fuel\\Core\\Input' => COREPATH.'classes/input.php',
'Fuel\\Core\\Lang' => COREPATH.'classes/lang.php',
'Fuel\\Core\\Log' => COREPATH.'classes/log.php',
'Fuel\\Core\\Migrate' => COREPATH.'classes/migrate.php',
'Fuel\\Core\\Model' => COREPATH.'classes/model.php',
'Fuel\\Core\\Mongo_Db' => COREPATH.'classes/mongo/db.php',
'Fuel\\Core\\Mongo_DbException' => COREPATH.'classes/mongo/db.php',
'Fuel\\Core\\Output' => COREPATH.'classes/output.php',
'Fuel\\Core\\Package' => COREPATH.'classes/package.php',
'Fuel\\Core\\PackageNotFoundException' => COREPATH.'classes/package.php',
'Fuel\\Core\\Pagination' => COREPATH.'classes/pagination.php',
'Fuel\\Core\\Profiler' => COREPATH.'classes/profiler.php',
'Fuel\\Core\\Request' => COREPATH.'classes/request.php',
'Fuel\\Core\\Request404Exception' => COREPATH.'classes/request.php',
'Fuel\\Core\\Redis' => COREPATH.'classes/redis.php',
'Fuel\\Core\\Rest' => COREPATH.'classes/rest.php',
'Fuel\\Core\\RestException' => COREPATH.'classes/rest.php',
'Fuel\\Core\\Rest_Driver' => COREPATH.'classes/rest/driver.php',
'Fuel\\Core\\Rest_Curl' => COREPATH.'classes/rest/curl.php',
'Fuel\\Core\\Rest_Wrapper' => COREPATH.'classes/rest/wrapper.php',
'Fuel\\Core\\Rest_Sockets' => COREPATH.'classes/rest/sockets.php',
'Fuel\\Core\\Response' => COREPATH.'classes/response.php',
'Fuel\\Core\\Route' => COREPATH.'classes/route.php',
'Fuel\\Core\\Router' => COREPATH.'classes/router.php',
'Fuel\\Core\\Security' => COREPATH.'classes/security.php',
'Fuel\\Core\\Session' => COREPATH.'classes/session.php',
'Fuel\\Core\\Session_Driver' => COREPATH.'classes/session/driver.php',
'Fuel\\Core\\Session_Db' => COREPATH.'classes/session/db.php',
'Fuel\\Core\\Session_Cookie' => COREPATH.'classes/session/cookie.php',
'Fuel\\Core\\Session_File' => COREPATH.'classes/session/file.php',
'Fuel\\Core\\Session_Memcached' => COREPATH.'classes/session/memcached.php',
'Fuel\\Core\\Session_Redis' => COREPATH.'classes/session/redis.php',
'Fuel\\Core\\Num' => COREPATH.'classes/num.php',
'Fuel\\Core\\Str' => COREPATH.'classes/str.php',
'Fuel\\Core\\TestCase' => COREPATH.'classes/testcase.php',
'Fuel\\Core\\Uri' => COREPATH.'classes/uri.php',
'Fuel\\Core\\Unzip' => COREPATH.'classes/unzip.php',
'Fuel\\Core\\Upload' => COREPATH.'classes/upload.php',
'Fuel\\Core\\Validation' => COREPATH.'classes/validation.php',
'Fuel\\Core\\Validation_Error' => COREPATH.'classes/validation/error.php',
'Fuel\\Core\\View' => COREPATH.'classes/view.php',
'Fuel\\Core\\ViewModel' => COREPATH.'classes/viewmodel.php',
));
};