blob: 1f10c452da8ae915037210b45d0b32055a23ea36 [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
darwinel871754a2014-02-11 17:34:57 +010021 * @copyright Copyright (c) 2008 - 2014, 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 {
Andrey Andreev30d53242014-01-16 14:41:46 +020056 require_once(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
Greg Akerd96f8822011-12-27 16:23:47 -060057 }
Andrey Andreevb6fbcbe2013-11-17 18:06:18 +020058
Andrey Andreev30d53242014-01-16 14:41:46 +020059 require_once(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 * ------------------------------------------------------
Andrey Andreeveb555ed2014-02-12 19:25:01 +0200127 *
128 * Note: It is important that Config is loaded first as
129 * most other classes depend on it either directly or by
130 * depending on another class that uses it.
131 *
Barry Mienydd671972010-10-04 16:33:58 +0200132 */
Derek Jones218876c2010-03-02 13:11:00 -0600133 $CFG =& load_class('Config', 'core');
134
135 // Do we have any manually set config items in the index.php file?
Andrey Andreev5232ba02012-10-27 15:25:05 +0300136 if (isset($assign_to_config) && is_array($assign_to_config))
Barry Mienydd671972010-10-04 16:33:58 +0200137 {
Andrey Andreev5232ba02012-10-27 15:25:05 +0300138 foreach ($assign_to_config as $key => $value)
139 {
140 $CFG->set_item($key, $value);
141 }
Derek Jones218876c2010-03-02 13:11:00 -0600142 }
143
144/*
145 * ------------------------------------------------------
Andrey Andreeveb555ed2014-02-12 19:25:01 +0200146 * Important charset-related stuff
Derek Jones218876c2010-03-02 13:11:00 -0600147 * ------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200148 *
Andrey Andreeveb555ed2014-02-12 19:25:01 +0200149 * Configure mbstring and/or iconv if they are enabled
150 * and set MB_ENABLED and ICONV_ENABLED constants, so
151 * that we don't repeatedly do extension_loaded() or
152 * function_exists() calls.
Barry Mienydd671972010-10-04 16:33:58 +0200153 *
Andrey Andreeveb555ed2014-02-12 19:25:01 +0200154 * Note: UTF-8 class depends on this. It used to be done
155 * in it's constructor, but it's _not_ class-specific.
156 *
157 */
158 $charset = strtoupper(config_item('charset'));
159
160 if (extension_loaded('mbstring'))
161 {
162 define('MB_ENABLED', TRUE);
163 mb_internal_encoding($charset);
164 // This is required for mb_convert_encoding() to strip invalid characters.
165 // That's utilized by CI_Utf8, but it's also done for consistency with iconv.
166 mb_substitute_character('none');
167 }
168 else
169 {
170 define('MB_ENABLED', FALSE);
171 }
172
173 // There's an ICONV_IMPL constant, but the PHP manual says that using
174 // iconv's predefined constants is "strongly discouraged".
175 if (extension_loaded('iconv'))
176 {
177 define('ICONV_ENABLED', TRUE);
178 iconv_set_encoding('internal_encoding', $charset);
179 }
180 else
181 {
182 define('ICONV_ENABLED', FALSE);
183 }
184
185/*
186 * ------------------------------------------------------
Andrey Andreev3fd1b382014-02-13 03:01:31 +0200187 * Load compatibility features
188 * ------------------------------------------------------
189 */
190
Andrey Andreev376b2152014-02-13 12:35:52 +0200191 require_once(BASEPATH.'core/compat/mbstring.php');
192 require_once(BASEPATH.'core/compat/password.php');
Andrey Andreev3fd1b382014-02-13 03:01:31 +0200193
194/*
195 * ------------------------------------------------------
Andrey Andreeveb555ed2014-02-12 19:25:01 +0200196 * Instantiate the UTF-8 class
197 * ------------------------------------------------------
Derek Allard2067d1a2008-11-13 22:59:24 +0000198 */
Pascal Krieteaaec1e42011-01-20 00:01:21 -0500199 $UNI =& load_class('Utf8', 'core');
Barry Mienydd671972010-10-04 16:33:58 +0200200
Derek Jones218876c2010-03-02 13:11:00 -0600201/*
202 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500203 * Instantiate the URI class
Derek Jones218876c2010-03-02 13:11:00 -0600204 * ------------------------------------------------------
205 */
206 $URI =& load_class('URI', 'core');
207
208/*
209 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500210 * Instantiate the routing class and set the routing
Derek Jones218876c2010-03-02 13:11:00 -0600211 * ------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200212 */
Derek Jones218876c2010-03-02 13:11:00 -0600213 $RTR =& load_class('Router', 'core');
Barry Mienydd671972010-10-04 16:33:58 +0200214
Derek Jones218876c2010-03-02 13:11:00 -0600215/*
216 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500217 * Instantiate the output class
Derek Jones218876c2010-03-02 13:11:00 -0600218 * ------------------------------------------------------
219 */
220 $OUT =& load_class('Output', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000221
222/*
223 * ------------------------------------------------------
Andrey Andreev9c5c24a2012-01-07 18:51:21 +0200224 * Is there a valid cache file? If so, we're done...
Derek Allard2067d1a2008-11-13 22:59:24 +0000225 * ------------------------------------------------------
226 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300227 if ($EXT->call_hook('cache_override') === FALSE
Alex Bilbieed944a32012-06-02 11:07:47 +0100228 && $OUT->_display_cache($CFG, $URI) === TRUE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000229 {
Andrey Andreev9c5c24a2012-01-07 18:51:21 +0200230 exit;
Derek Allard2067d1a2008-11-13 22:59:24 +0000231 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000232
233/*
Pascal Kriete14a0ac62011-04-05 14:55:56 -0400234 * -----------------------------------------------------
235 * Load the security class for xss and csrf support
236 * -----------------------------------------------------
237 */
238 $SEC =& load_class('Security', 'core');
239
240/*
Derek Allard2067d1a2008-11-13 22:59:24 +0000241 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500242 * Load the Input class and sanitize globals
Derek Allard2067d1a2008-11-13 22:59:24 +0000243 * ------------------------------------------------------
244 */
Barry Mienydd671972010-10-04 16:33:58 +0200245 $IN =& load_class('Input', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000246
Derek Jones218876c2010-03-02 13:11:00 -0600247/*
248 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500249 * Load the Language class
Derek Jones218876c2010-03-02 13:11:00 -0600250 * ------------------------------------------------------
251 */
252 $LANG =& load_class('Lang', 'core');
Derek Allard2067d1a2008-11-13 22:59:24 +0000253
254/*
255 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500256 * Load the app controller and local controller
Derek Allard2067d1a2008-11-13 22:59:24 +0000257 * ------------------------------------------------------
258 *
Derek Allard2067d1a2008-11-13 22:59:24 +0000259 */
Derek Jones218876c2010-03-02 13:11:00 -0600260 // Load the base controller class
Andrey Andreev30d53242014-01-16 14:41:46 +0200261 require_once BASEPATH.'core/Controller.php';
Barry Mienydd671972010-10-04 16:33:58 +0200262
Timothy Warrenad475052012-04-19 13:21:06 -0400263 /**
264 * Reference to the CI_Controller method.
265 *
266 * Returns current CI instance object
267 *
268 * @return object
269 */
Greg Aker4abfa682010-11-10 14:44:26 -0600270 function &get_instance()
271 {
272 return CI_Controller::get_instance();
273 }
274
Greg Aker3a746652011-04-19 10:59:47 -0500275 if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'))
Greg Akerfa281352010-03-22 14:41:27 -0500276 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200277 require_once APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php';
Greg Akerfa281352010-03-22 14:41:27 -0500278 }
Barry Mienydd671972010-10-04 16:33:58 +0200279
Derek Jones218876c2010-03-02 13:11:00 -0600280 // Set a mark point for benchmarking
281 $BM->mark('loading_time:_base_classes_end');
Derek Allard2067d1a2008-11-13 22:59:24 +0000282
283/*
284 * ------------------------------------------------------
Andrey Andreev30d53242014-01-16 14:41:46 +0200285 * Sanity checks
Derek Allard2067d1a2008-11-13 22:59:24 +0000286 * ------------------------------------------------------
287 *
Andrey Andreev30d53242014-01-16 14:41:46 +0200288 * The Router class has already validated the request,
289 * leaving us with 3 options here:
290 *
291 * 1) an empty class name, if we reached the default
292 * controller, but it didn't exist;
293 * 2) a query string which doesn't go through a
294 * file_exists() check
295 * 3) a regular request for a non-existing page
296 *
297 * We handle all of these as a 404 error.
298 *
299 * Furthermore, none of the methods in the app controller
300 * or the loader class can be called via the URI, nor can
Andrey Andreev20292312013-07-22 14:29:10 +0300301 * controller methods that begin with an underscore.
Derek Allard2067d1a2008-11-13 22:59:24 +0000302 */
Barry Mienydd671972010-10-04 16:33:58 +0200303
Andrey Andreev30d53242014-01-16 14:41:46 +0200304 $e404 = FALSE;
305 $class = ucfirst($RTR->class);
306 $method = $RTR->method;
307
308 if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
Derek Jones218876c2010-03-02 13:11:00 -0600309 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200310 $e404 = TRUE;
Andrey Andreev38e32f62012-11-03 00:16:47 +0200311 }
312 else
313 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200314 require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
315
316 if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
317 {
318 $e404 = TRUE;
319 }
320 elseif (method_exists($class, '_remap'))
321 {
322 $params = array($method, array_slice($URI->rsegments, 2));
323 $method = '_remap';
324 }
Andrey Andreev522c7362012-11-05 16:40:32 +0200325 // WARNING: It appears that there are issues with is_callable() even in PHP 5.2!
326 // Furthermore, there are bug reports and feature/change requests related to it
327 // that make it unreliable to use in this context. Please, DO NOT change this
328 // work-around until a better alternative is available.
Andrey Andreev30d53242014-01-16 14:41:46 +0200329 elseif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE))
Andrey Andreev38e32f62012-11-03 00:16:47 +0200330 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200331 $e404 = TRUE;
332 }
333 }
334
335 if ($e404)
336 {
337 if ( ! empty($RTR->routes['404_override']))
338 {
339 if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $error_class, $error_method) !== 2)
Andrey Andreev38e32f62012-11-03 00:16:47 +0200340 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200341 $error_method = 'index';
Andrey Andreev38e32f62012-11-03 00:16:47 +0200342 }
343
Andrey Andreev30d53242014-01-16 14:41:46 +0200344 $error_class = ucfirst($error_class);
Andrey Andreev20292312013-07-22 14:29:10 +0300345
Andrey Andreev30d53242014-01-16 14:41:46 +0200346 if ( ! class_exists($error_class, FALSE))
Andrey Andreev38e32f62012-11-03 00:16:47 +0200347 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200348 if (file_exists(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php'))
Andrey Andreev38e32f62012-11-03 00:16:47 +0200349 {
Andrey Andreev30d53242014-01-16 14:41:46 +0200350 require_once(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php');
351 $e404 = ! class_exists($error_class, FALSE);
Andrey Andreev38e32f62012-11-03 00:16:47 +0200352 }
Andrey Andreev30d53242014-01-16 14:41:46 +0200353 // Were we in a directory? If so, check for a global override
354 elseif ( ! empty($RTR->directory) && file_exists(APPPATH.'controllers/'.$error_class.'.php'))
355 {
356 require_once(APPPATH.'controllers/'.$error_class.'.php');
357 if (($e404 = ! class_exists($error_class, FALSE)) === FALSE)
358 {
359 $RTR->directory = '';
360 }
361 }
362 }
363 else
364 {
365 $e404 = FALSE;
Andrey Andreev38e32f62012-11-03 00:16:47 +0200366 }
367 }
368
Andrey Andreev30d53242014-01-16 14:41:46 +0200369 // Did we reset the $e404 flag? If so, set the rsegments, starting from index 1
370 if ( ! $e404)
371 {
372 $class = $error_class;
373 $method = $error_method;
374
375 $URI->rsegments = array(
376 1 => $class,
377 2 => $method
378 );
379 }
380 else
381 {
382 show_404($RTR->directory.$class.'/'.$method);
383 }
384 }
385
386 if ($method !== '_remap')
387 {
Andrey Andreev38e32f62012-11-03 00:16:47 +0200388 $params = array_slice($URI->rsegments, 2);
389 }
390
Derek Allard2067d1a2008-11-13 22:59:24 +0000391/*
392 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500393 * Is there a "pre_controller" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000394 * ------------------------------------------------------
395 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300396 $EXT->call_hook('pre_controller');
Derek Allard2067d1a2008-11-13 22:59:24 +0000397
398/*
399 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500400 * Instantiate the requested controller
Derek Allard2067d1a2008-11-13 22:59:24 +0000401 * ------------------------------------------------------
402 */
Derek Jones218876c2010-03-02 13:11:00 -0600403 // Mark a start point so we can benchmark the controller
404 $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
Barry Mienydd671972010-10-04 16:33:58 +0200405
Derek Jones218876c2010-03-02 13:11:00 -0600406 $CI = new $class();
407
408/*
409 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500410 * Is there a "post_controller_constructor" hook?
Derek Jones218876c2010-03-02 13:11:00 -0600411 * ------------------------------------------------------
412 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300413 $EXT->call_hook('post_controller_constructor');
Derek Jones218876c2010-03-02 13:11:00 -0600414
415/*
416 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500417 * Call the requested method
Derek Jones218876c2010-03-02 13:11:00 -0600418 * ------------------------------------------------------
419 */
Andrey Andreev38e32f62012-11-03 00:16:47 +0200420 call_user_func_array(array(&$CI, $method), $params);
Derek Allard2067d1a2008-11-13 22:59:24 +0000421
Derek Jones218876c2010-03-02 13:11:00 -0600422 // Mark a benchmark end point
423 $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
Derek Allard2067d1a2008-11-13 22:59:24 +0000424
425/*
426 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500427 * Is there a "post_controller" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000428 * ------------------------------------------------------
429 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300430 $EXT->call_hook('post_controller');
Derek Allard2067d1a2008-11-13 22:59:24 +0000431
432/*
433 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500434 * Send the final rendered output to the browser
Derek Allard2067d1a2008-11-13 22:59:24 +0000435 * ------------------------------------------------------
436 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300437 if ($EXT->call_hook('display_override') === FALSE)
Derek Jones218876c2010-03-02 13:11:00 -0600438 {
439 $OUT->_display();
440 }
Barry Mienydd671972010-10-04 16:33:58 +0200441
Derek Allard2067d1a2008-11-13 22:59:24 +0000442/*
443 * ------------------------------------------------------
Derek Jones37f4b9c2011-07-01 17:56:50 -0500444 * Is there a "post_system" hook?
Derek Allard2067d1a2008-11-13 22:59:24 +0000445 * ------------------------------------------------------
446 */
Andrey Andreeva5dd2972012-03-26 14:43:01 +0300447 $EXT->call_hook('post_system');
Derek Allard2067d1a2008-11-13 22:59:24 +0000448
Derek Allard2067d1a2008-11-13 22:59:24 +0000449/* End of file CodeIgniter.php */
Andrey Andreevb6fbcbe2013-11-17 18:06:18 +0200450/* Location: ./system/core/CodeIgniter.php */