blob: 45c3485bf656b274088e35034419279fcdb2bcc2 [file] [log] [blame]
Andrey Andreevc5536aa2012-11-01 17:33:58 +02001<?php
Derek Allard2067d1a2008-11-13 22:59:24 +00002/**
3 * CodeIgniter
4 *
Phil Sturgeon07c1ac82012-03-09 17:03:37 +00005 * An open source application development framework for PHP 5.2.4 or newer
Derek Allard2067d1a2008-11-13 22:59:24 +00006 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05007 * NOTICE OF LICENSE
Andrey Andreev9c5c24a2012-01-07 18:51:21 +02008 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05009 * Licensed under the Open Software License version 3.0
Andrey Andreev9c5c24a2012-01-07 18:51:21 +020010 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -050011 * This source file is subject to the Open Software License (OSL 3.0) that is
12 * bundled with this package in the files license.txt / license.rst. It is
13 * also available through the world wide web at this URL:
14 * http://opensource.org/licenses/OSL-3.0
15 * If you did not receive a copy of the license and are unable to obtain it
16 * through the world wide web, please send an email to
17 * licensing@ellislab.com so we can send you a copy immediately.
18 *
Derek Allard2067d1a2008-11-13 22:59:24 +000019 * @package CodeIgniter
Derek Jonesf4a4bd82011-10-20 12:18:42 -050020 * @author EllisLab Dev Team
Andrey Andreev80500af2013-01-01 08:16:53 +020021 * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/)
Derek Jonesf4a4bd82011-10-20 12:18:42 -050022 * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
Derek Allard2067d1a2008-11-13 22:59:24 +000023 * @link http://codeigniter.com
24 * @since Version 1.0
25 * @filesource
26 */
Andrey Andreevc5536aa2012-11-01 17:33:58 +020027defined('BASEPATH') OR exit('No direct script access allowed');
Derek Allard2067d1a2008-11-13 22:59:24 +000028
Derek Allard2067d1a2008-11-13 22:59:24 +000029/**
Derek Jones218876c2010-03-02 13:11:00 -060030 * System Initialization File
Derek Allard2067d1a2008-11-13 22:59:24 +000031 *
32 * Loads the base classes and executes the request.
33 *
34 * @package CodeIgniter
Andrey Andreev92ebfb62012-05-17 12:49:24 +030035 * @subpackage CodeIgniter
Derek Allard2067d1a2008-11-13 22:59:24 +000036 * @category Front-controller
Derek Jonesf4a4bd82011-10-20 12:18:42 -050037 * @author EllisLab Dev Team
Derek Allard2067d1a2008-11-13 22:59:24 +000038 * @link http://codeigniter.com/user_guide/
39 */
40
Phil Sturgeond8ef6302011-08-14 12:10:55 -060041/**
42 * CodeIgniter Version
43 *
Timothy Warren48a7fbb2012-04-23 11:58:16 -040044 * @var string
Phil Sturgeond8ef6302011-08-14 12:10:55 -060045 *
Derek Jones218876c2010-03-02 13:11:00 -060046 */
Derek Jonesf4a4bd82011-10-20 12:18:42 -050047 define('CI_VERSION', '3.0-dev');
Andrey Andreevb6fbcbe2013-11-17 18:06:18 +020048
Derek Allard2067d1a2008-11-13 22:59:24 +000049/*
50 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -050051 * Load the framework constants
Derek Allard2067d1a2008-11-13 22:59:24 +000052 * ------------------------------------------------------
53 */
Andrey Andreevdb529ca2013-01-28 11:00:02 +020054 if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
Greg Akerd96f8822011-12-27 16:23:47 -060055 {
56 require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
57 }
Andrey Andreevb6fbcbe2013-11-17 18:06:18 +020058
59 require(APPPATH.'config/constants.php');
Derek Allard2067d1a2008-11-13 22:59:24 +000060
61/*
62 * ------------------------------------------------------
josephok1095d112013-11-16 09:33:37 +080063 * Load the global functions
64 * ------------------------------------------------------
65 */
66 require_once(BASEPATH.'core/Common.php');
67
68/*
69 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -050070 * Define a custom error handler so we can log PHP errors
Derek Allard2067d1a2008-11-13 22:59:24 +000071 * ------------------------------------------------------
72 */
Derek Jones218876c2010-03-02 13:11:00 -060073 set_error_handler('_exception_handler');
Kaiwang Chen21fe9da2013-09-11 13:09:41 +080074 register_shutdown_function('_shutdown_handler');
Barry Mienydd671972010-10-04 16:33:58 +020075
Andrey Andreev5932a732013-09-13 14:45:53 +030076 // Kill magic quotes
77 is_php('5.4') OR @ini_set('magic_quotes_runtime', 0);
Derek Jones962d2252009-08-05 04:26:11 +000078
Derek Jones218876c2010-03-02 13:11:00 -060079/*
80 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -050081 * Set the subclass_prefix
Derek Jones218876c2010-03-02 13:11:00 -060082 * ------------------------------------------------------
83 *
Barry Mienydd671972010-10-04 16:33:58 +020084 * Normally the "subclass_prefix" is set in the config file.
85 * The subclass prefix allows CI to know if a core class is
Derek Jones218876c2010-03-02 13:11:00 -060086 * being extended via a library in the local application
Barry Mienydd671972010-10-04 16:33:58 +020087 * "libraries" folder. Since CI allows config items to be
vlakoff8d70c0a2013-08-17 07:31:29 +020088 * overriden via data set in the main index.php file,
Barry Mienydd671972010-10-04 16:33:58 +020089 * before proceeding we need to know if a subclass_prefix
Andrey Andreev9c5c24a2012-01-07 18:51:21 +020090 * override exists. If so, we will set this value now,
Derek Jones218876c2010-03-02 13:11:00 -060091 * before any classes are loaded
Barry Mienydd671972010-10-04 16:33:58 +020092 * Note: Since the config file data is cached it doesn't
Derek Jones218876c2010-03-02 13:11:00 -060093 * hurt to load it here.
94 */
Andrey Andreev9ba661b2012-06-04 14:44:34 +030095 if ( ! empty($assign_to_config['subclass_prefix']))
Derek Jones218876c2010-03-02 13:11:00 -060096 {
97 get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix']));
98 }
Eric Barnesc5bf6162011-01-30 21:17:11 -050099
Pascal Krietef566af52010-11-09 13:03:26 -0500100/*
101 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500102 * Start the timer... tick tock tick tock...
Derek Allard2067d1a2008-11-13 22:59:24 +0000103 * ------------------------------------------------------
104 */
Derek Jones218876c2010-03-02 13:11:00 -0600105 $BM =& load_class('Benchmark', 'core');
106 $BM->mark('total_execution_time_start');
107 $BM->mark('loading_time:_base_classes_start');
Derek Allard2067d1a2008-11-13 22:59:24 +0000108
109/*
110 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500111 * Instantiate the hooks class
Derek Allard2067d1a2008-11-13 22:59:24 +0000112 * ------------------------------------------------------
113 */
Derek Jones218876c2010-03-02 13:11:00 -0600114 $EXT =& load_class('Hooks', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000115
116/*
117 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500118 * Is there a "pre_system" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000119 * ------------------------------------------------------
120 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300121 $EXT->call_hook('pre_system');
Derek Allard2067d1a2008-11-13 22:59:24 +0000122
123/*
124 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500125 * Instantiate the config class
Derek Allard2067d1a2008-11-13 22:59:24 +0000126 * ------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200127 */
Derek Jones218876c2010-03-02 13:11:00 -0600128 $CFG =& load_class('Config', 'core');
129
130 // Do we have any manually set config items in the index.php file?
Andrey Andreev5232ba02012-10-27 15:25:05 +0300131 if (isset($assign_to_config) && is_array($assign_to_config))
Barry Mienydd671972010-10-04 16:33:58 +0200132 {
Andrey Andreev5232ba02012-10-27 15:25:05 +0300133 foreach ($assign_to_config as $key => $value)
134 {
135 $CFG->set_item($key, $value);
136 }
Derek Jones218876c2010-03-02 13:11:00 -0600137 }
138
139/*
140 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500141 * Instantiate the UTF-8 class
Derek Jones218876c2010-03-02 13:11:00 -0600142 * ------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200143 *
Pascal Krieteaaec1e42011-01-20 00:01:21 -0500144 * Note: Order here is rather important as the UTF-8
Derek Jones218876c2010-03-02 13:11:00 -0600145 * class needs to be used very early on, but it cannot
Chris Berthe827b3f02012-04-27 23:36:54 -0400146 * properly determine if UTF-8 can be supported until
Derek Jones218876c2010-03-02 13:11:00 -0600147 * after the Config class is instantiated.
Barry Mienydd671972010-10-04 16:33:58 +0200148 *
Derek Allard2067d1a2008-11-13 22:59:24 +0000149 */
Pascal Krieteaaec1e42011-01-20 00:01:21 -0500150 $UNI =& load_class('Utf8', 'core');
Barry Mienydd671972010-10-04 16:33:58 +0200151
Derek Jones218876c2010-03-02 13:11:00 -0600152/*
153 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500154 * Instantiate the URI class
Derek Jones218876c2010-03-02 13:11:00 -0600155 * ------------------------------------------------------
156 */
157 $URI =& load_class('URI', 'core');
158
159/*
160 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500161 * Instantiate the routing class and set the routing
Derek Jones218876c2010-03-02 13:11:00 -0600162 * ------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200163 */
Derek Jones218876c2010-03-02 13:11:00 -0600164 $RTR =& load_class('Router', 'core');
Barry Mienydd671972010-10-04 16:33:58 +0200165
Derek Jones218876c2010-03-02 13:11:00 -0600166 // Set any routing overrides that may exist in the main index file
167 if (isset($routing))
168 {
169 $RTR->_set_overrides($routing);
170 }
171
172/*
173 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500174 * Instantiate the output class
Derek Jones218876c2010-03-02 13:11:00 -0600175 * ------------------------------------------------------
176 */
177 $OUT =& load_class('Output', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000178
179/*
180 * ------------------------------------------------------
Andrey Andreev9c5c24a2012-01-07 18:51:21 +0200181 * Is there a valid cache file? If so, we're done...
Derek Allard2067d1a2008-11-13 22:59:24 +0000182 * ------------------------------------------------------
183 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300184 if ($EXT->call_hook('cache_override') === FALSE
Alex Bilbieed944a32012-06-02 11:07:47 +0100185 && $OUT->_display_cache($CFG, $URI) === TRUE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000186 {
Andrey Andreev9c5c24a2012-01-07 18:51:21 +0200187 exit;
Derek Allard2067d1a2008-11-13 22:59:24 +0000188 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000189
190/*
Pascal Kriete14a0ac62011-04-05 14:55:56 -0400191 * -----------------------------------------------------
192 * Load the security class for xss and csrf support
193 * -----------------------------------------------------
194 */
195 $SEC =& load_class('Security', 'core');
196
197/*
Derek Allard2067d1a2008-11-13 22:59:24 +0000198 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500199 * Load the Input class and sanitize globals
Derek Allard2067d1a2008-11-13 22:59:24 +0000200 * ------------------------------------------------------
201 */
Barry Mienydd671972010-10-04 16:33:58 +0200202 $IN =& load_class('Input', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000203
Derek Jones218876c2010-03-02 13:11:00 -0600204/*
205 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500206 * Load the Language class
Derek Jones218876c2010-03-02 13:11:00 -0600207 * ------------------------------------------------------
208 */
209 $LANG =& load_class('Lang', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000210
211/*
212 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500213 * Load the app controller and local controller
Derek Allard2067d1a2008-11-13 22:59:24 +0000214 * ------------------------------------------------------
215 *
Derek Allard2067d1a2008-11-13 22:59:24 +0000216 */
Derek Jones218876c2010-03-02 13:11:00 -0600217 // Load the base controller class
Greg Aker3a746652011-04-19 10:59:47 -0500218 require BASEPATH.'core/Controller.php';
Barry Mienydd671972010-10-04 16:33:58 +0200219
Timothy Warrenad475052012-04-19 13:21:06 -0400220 /**
221 * Reference to the CI_Controller method.
222 *
223 * Returns current CI instance object
224 *
225 * @return object
226 */
Greg Aker4abfa682010-11-10 14:44:26 -0600227 function &get_instance()
228 {
229 return CI_Controller::get_instance();
230 }
231
Greg Aker3a746652011-04-19 10:59:47 -0500232 if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'))
Greg Akerfa281352010-03-22 14:41:27 -0500233 {
Greg Aker3a746652011-04-19 10:59:47 -0500234 require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php';
Greg Akerfa281352010-03-22 14:41:27 -0500235 }
Barry Mienydd671972010-10-04 16:33:58 +0200236
Derek Jones218876c2010-03-02 13:11:00 -0600237 // Load the local application controller
Barry Mienydd671972010-10-04 16:33:58 +0200238 // Note: The Router class automatically validates the controller path using the router->_validate_request().
Derek Jones218876c2010-03-02 13:11:00 -0600239 // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid.
Andrey Andreev20292312013-07-22 14:29:10 +0300240 $class = ucfirst($RTR->class);
241 if ( ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
Derek Jones218876c2010-03-02 13:11:00 -0600242 {
Pascal Krieteebb6f4b2010-11-10 17:09:21 -0500243 show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
Derek Jones218876c2010-03-02 13:11:00 -0600244 }
Barry Mienydd671972010-10-04 16:33:58 +0200245
Andrey Andreev20292312013-07-22 14:29:10 +0300246 include(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
Barry Mienydd671972010-10-04 16:33:58 +0200247
Derek Jones218876c2010-03-02 13:11:00 -0600248 // Set a mark point for benchmarking
249 $BM->mark('loading_time:_base_classes_end');
Derek Allard2067d1a2008-11-13 22:59:24 +0000250
251/*
252 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500253 * Security check
Derek Allard2067d1a2008-11-13 22:59:24 +0000254 * ------------------------------------------------------
255 *
Andrey Andreev7d394f82012-11-02 04:37:34 +0200256 * None of the methods in the app controller or the
Derek Jones37f4b9c2011-07-01 17:56:50 -0500257 * loader class can be called via the URI, nor can
Andrey Andreev20292312013-07-22 14:29:10 +0300258 * controller methods that begin with an underscore.
Derek Allard2067d1a2008-11-13 22:59:24 +0000259 */
Andrey Andreev0e4237f2013-04-04 16:53:21 +0300260 $method = $RTR->method;
Barry Mienydd671972010-10-04 16:33:58 +0200261
Andrey Andreev49e68de2013-02-21 16:30:55 +0200262 if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
Derek Jones218876c2010-03-02 13:11:00 -0600263 {
Shane Pearson664a9352011-08-10 16:02:32 -0500264 if ( ! empty($RTR->routes['404_override']))
265 {
Andrey Andreev533bf2d2012-11-02 22:44:29 +0200266 if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2)
267 {
268 $method = 'index';
269 }
270
Andrey Andreev20292312013-07-22 14:29:10 +0300271 $class = ucfirst($class);
272
Andrey Andreev49e68de2013-02-21 16:30:55 +0200273 if ( ! class_exists($class, FALSE))
Shane Pearson664a9352011-08-10 16:02:32 -0500274 {
275 if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
276 {
Andrey Andreevb3f774b2012-04-23 12:57:57 +0300277 show_404($class.'/'.$method);
Shane Pearson664a9352011-08-10 16:02:32 -0500278 }
279
280 include_once(APPPATH.'controllers/'.$class.'.php');
281 }
282 }
283 else
284 {
Andrey Andreevb3f774b2012-04-23 12:57:57 +0300285 show_404($class.'/'.$method);
Shane Pearson664a9352011-08-10 16:02:32 -0500286 }
Derek Jones218876c2010-03-02 13:11:00 -0600287 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000288
Andrey Andreev38e32f62012-11-03 00:16:47 +0200289 if (method_exists($class, '_remap'))
290 {
291 $params = array($method, array_slice($URI->rsegments, 2));
292 $method = '_remap';
293 }
294 else
295 {
Andrey Andreev522c7362012-11-05 16:40:32 +0200296 // WARNING: It appears that there are issues with is_callable() even in PHP 5.2!
297 // Furthermore, there are bug reports and feature/change requests related to it
298 // that make it unreliable to use in this context. Please, DO NOT change this
299 // work-around until a better alternative is available.
300 if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE))
Andrey Andreev38e32f62012-11-03 00:16:47 +0200301 {
302 if (empty($RTR->routes['404_override']))
303 {
304 show_404($class.'/'.$method);
305 }
306 elseif (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2)
307 {
308 $method = 'index';
309 }
310
Andrey Andreev20292312013-07-22 14:29:10 +0300311 $class = ucfirst($class);
312
Andrey Andreev49e68de2013-02-21 16:30:55 +0200313 if ( ! class_exists($class, FALSE))
Andrey Andreev38e32f62012-11-03 00:16:47 +0200314 {
315 if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
316 {
317 show_404($class.'/'.$method);
318 }
319
320 include_once(APPPATH.'controllers/'.$class.'.php');
321 }
322 }
323
324 $params = array_slice($URI->rsegments, 2);
325 }
326
Derek Allard2067d1a2008-11-13 22:59:24 +0000327/*
328 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500329 * Is there a "pre_controller" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000330 * ------------------------------------------------------
331 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300332 $EXT->call_hook('pre_controller');
Derek Allard2067d1a2008-11-13 22:59:24 +0000333
334/*
335 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500336 * Instantiate the requested controller
Derek Allard2067d1a2008-11-13 22:59:24 +0000337 * ------------------------------------------------------
338 */
Derek Jones218876c2010-03-02 13:11:00 -0600339 // Mark a start point so we can benchmark the controller
340 $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
Barry Mienydd671972010-10-04 16:33:58 +0200341
Derek Jones218876c2010-03-02 13:11:00 -0600342 $CI = new $class();
343
344/*
345 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500346 * Is there a "post_controller_constructor" hook?
Derek Jones218876c2010-03-02 13:11:00 -0600347 * ------------------------------------------------------
348 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300349 $EXT->call_hook('post_controller_constructor');
Derek Jones218876c2010-03-02 13:11:00 -0600350
351/*
352 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500353 * Call the requested method
Derek Jones218876c2010-03-02 13:11:00 -0600354 * ------------------------------------------------------
355 */
Andrey Andreev38e32f62012-11-03 00:16:47 +0200356 call_user_func_array(array(&$CI, $method), $params);
Derek Allard2067d1a2008-11-13 22:59:24 +0000357
Derek Jones218876c2010-03-02 13:11:00 -0600358 // Mark a benchmark end point
359 $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
Derek Allard2067d1a2008-11-13 22:59:24 +0000360
361/*
362 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500363 * Is there a "post_controller" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000364 * ------------------------------------------------------
365 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300366 $EXT->call_hook('post_controller');
Derek Allard2067d1a2008-11-13 22:59:24 +0000367
368/*
369 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500370 * Send the final rendered output to the browser
Derek Allard2067d1a2008-11-13 22:59:24 +0000371 * ------------------------------------------------------
372 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300373 if ($EXT->call_hook('display_override') === FALSE)
Derek Jones218876c2010-03-02 13:11:00 -0600374 {
375 $OUT->_display();
376 }
Barry Mienydd671972010-10-04 16:33:58 +0200377
Derek Allard2067d1a2008-11-13 22:59:24 +0000378/*
379 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500380 * Is there a "post_system" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000381 * ------------------------------------------------------
382 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300383 $EXT->call_hook('post_system');
Derek Allard2067d1a2008-11-13 22:59:24 +0000384
Derek Allard2067d1a2008-11-13 22:59:24 +0000385/* End of file CodeIgniter.php */
Andrey Andreevb6fbcbe2013-11-17 18:06:18 +0200386/* Location: ./system/core/CodeIgniter.php */