Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
| 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Greg Aker | 741de1c | 2010-11-10 14:52:57 -0600 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.1.6 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
| 7 | * @package CodeIgniter |
| 8 | * @author ExpressionEngine Dev Team |
Greg Aker | 0711dc8 | 2011-01-05 10:49:40 -0600 | [diff] [blame] | 9 | * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 10 | * @license http://codeigniter.com/user_guide/license.html |
| 11 | * @link http://codeigniter.com |
| 12 | * @since Version 1.0 |
| 13 | * @filesource |
| 14 | */ |
| 15 | |
| 16 | // ------------------------------------------------------------------------ |
| 17 | |
| 18 | /** |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 19 | * System Initialization File |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 20 | * |
| 21 | * Loads the base classes and executes the request. |
| 22 | * |
| 23 | * @package CodeIgniter |
| 24 | * @subpackage codeigniter |
| 25 | * @category Front-controller |
| 26 | * @author ExpressionEngine Dev Team |
| 27 | * @link http://codeigniter.com/user_guide/ |
| 28 | */ |
| 29 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 30 | /* |
| 31 | * ------------------------------------------------------ |
| 32 | * Define the CodeIgniter Version |
| 33 | * ------------------------------------------------------ |
| 34 | */ |
| 35 | define('CI_VERSION', '2.0'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * ------------------------------------------------------ |
Phil Sturgeon | babfb29 | 2011-03-08 21:56:08 +0000 | [diff] [blame^] | 39 | * Define the CodeIgniter Branch (Core = TRUE, Reactor = FALSE) |
| 40 | * ------------------------------------------------------ |
| 41 | */ |
| 42 | define('CI_CORE', FALSE); |
| 43 | |
| 44 | /* |
| 45 | * ------------------------------------------------------ |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 46 | * Load the global functions |
| 47 | * ------------------------------------------------------ |
| 48 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 49 | require(BASEPATH.'core/Common'.EXT); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 50 | |
| 51 | /* |
| 52 | * ------------------------------------------------------ |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 53 | * Load the framework constants |
| 54 | * ------------------------------------------------------ |
| 55 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 56 | require(APPPATH.'config/constants'.EXT); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 57 | |
| 58 | /* |
| 59 | * ------------------------------------------------------ |
| 60 | * Define a custom error handler so we can log PHP errors |
| 61 | * ------------------------------------------------------ |
| 62 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 63 | set_error_handler('_exception_handler'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 64 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 65 | if ( ! is_php('5.3')) |
| 66 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 67 | @set_magic_quotes_runtime(0); // Kill magic quotes |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 68 | } |
Derek Jones | 962d225 | 2009-08-05 04:26:11 +0000 | [diff] [blame] | 69 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 70 | /* |
| 71 | * ------------------------------------------------------ |
| 72 | * Set the subclass_prefix |
| 73 | * ------------------------------------------------------ |
| 74 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 75 | * Normally the "subclass_prefix" is set in the config file. |
| 76 | * The subclass prefix allows CI to know if a core class is |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 77 | * being extended via a library in the local application |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 78 | * "libraries" folder. Since CI allows config items to be |
| 79 | * overriden via data set in the main index. php file, |
| 80 | * before proceeding we need to know if a subclass_prefix |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 81 | * override exists. If so, we will set this value now, |
| 82 | * before any classes are loaded |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 83 | * Note: Since the config file data is cached it doesn't |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 84 | * hurt to load it here. |
| 85 | */ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 86 | if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '') |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 87 | { |
| 88 | get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); |
| 89 | } |
Pascal Kriete | f566af5 | 2010-11-09 13:03:26 -0500 | [diff] [blame] | 90 | |
| 91 | /* |
| 92 | * ------------------------------------------------------ |
| 93 | * Set a liberal script execution time limit |
| 94 | * ------------------------------------------------------ |
| 95 | */ |
| 96 | if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) |
| 97 | { |
| 98 | @set_time_limit(300); |
| 99 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 100 | |
| 101 | /* |
| 102 | * ------------------------------------------------------ |
| 103 | * Start the timer... tick tock tick tock... |
| 104 | * ------------------------------------------------------ |
| 105 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 106 | $BM =& load_class('Benchmark', 'core'); |
| 107 | $BM->mark('total_execution_time_start'); |
| 108 | $BM->mark('loading_time:_base_classes_start'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 109 | |
| 110 | /* |
| 111 | * ------------------------------------------------------ |
| 112 | * Instantiate the hooks class |
| 113 | * ------------------------------------------------------ |
| 114 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 115 | $EXT =& load_class('Hooks', 'core'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 116 | |
| 117 | /* |
| 118 | * ------------------------------------------------------ |
| 119 | * Is there a "pre_system" hook? |
| 120 | * ------------------------------------------------------ |
| 121 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 122 | $EXT->_call_hook('pre_system'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 123 | |
| 124 | /* |
| 125 | * ------------------------------------------------------ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 126 | * Instantiate the config class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 127 | * ------------------------------------------------------ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 128 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 129 | $CFG =& load_class('Config', 'core'); |
| 130 | |
| 131 | // Do we have any manually set config items in the index.php file? |
| 132 | if (isset($assign_to_config)) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 133 | { |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 134 | $CFG->_assign_to_config($assign_to_config); |
| 135 | } |
| 136 | |
| 137 | /* |
| 138 | * ------------------------------------------------------ |
Pascal Kriete | aaec1e4 | 2011-01-20 00:01:21 -0500 | [diff] [blame] | 139 | * Instantiate the UTF-8 class |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 140 | * ------------------------------------------------------ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 141 | * |
Pascal Kriete | aaec1e4 | 2011-01-20 00:01:21 -0500 | [diff] [blame] | 142 | * Note: Order here is rather important as the UTF-8 |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 143 | * class needs to be used very early on, but it cannot |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 144 | * properly determine if UTf-8 can be supported until |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 145 | * after the Config class is instantiated. |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 146 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 147 | */ |
| 148 | |
Pascal Kriete | aaec1e4 | 2011-01-20 00:01:21 -0500 | [diff] [blame] | 149 | $UNI =& load_class('Utf8', 'core'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 150 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 151 | /* |
| 152 | * ------------------------------------------------------ |
| 153 | * Instantiate the URI class |
| 154 | * ------------------------------------------------------ |
| 155 | */ |
| 156 | $URI =& load_class('URI', 'core'); |
| 157 | |
| 158 | /* |
| 159 | * ------------------------------------------------------ |
| 160 | * Instantiate the routing class and set the routing |
| 161 | * ------------------------------------------------------ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 162 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 163 | $RTR =& load_class('Router', 'core'); |
| 164 | $RTR->_set_routing(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 165 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 166 | // 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 | * ------------------------------------------------------ |
| 174 | * Instantiate the output class |
| 175 | * ------------------------------------------------------ |
| 176 | */ |
| 177 | $OUT =& load_class('Output', 'core'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 178 | |
| 179 | /* |
| 180 | * ------------------------------------------------------ |
| 181 | * Is there a valid cache file? If so, we're done... |
| 182 | * ------------------------------------------------------ |
| 183 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 184 | if ($EXT->_call_hook('cache_override') === FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 185 | { |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 186 | if ($OUT->_display_cache($CFG, $URI) == TRUE) |
| 187 | { |
| 188 | exit; |
| 189 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 190 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 191 | |
| 192 | /* |
| 193 | * ------------------------------------------------------ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 194 | * Load the Input class and sanitize globals |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 195 | * ------------------------------------------------------ |
| 196 | */ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 197 | $IN =& load_class('Input', 'core'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 198 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 199 | /* |
| 200 | * ------------------------------------------------------ |
| 201 | * Load the Language class |
| 202 | * ------------------------------------------------------ |
| 203 | */ |
| 204 | $LANG =& load_class('Lang', 'core'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 205 | |
| 206 | /* |
| 207 | * ------------------------------------------------------ |
| 208 | * Load the app controller and local controller |
| 209 | * ------------------------------------------------------ |
| 210 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 211 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 212 | // Load the base controller class |
| 213 | require BASEPATH.'core/Controller'.EXT; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 214 | |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 215 | function &get_instance() |
| 216 | { |
| 217 | return CI_Controller::get_instance(); |
| 218 | } |
| 219 | |
| 220 | |
Greg Aker | fa28135 | 2010-03-22 14:41:27 -0500 | [diff] [blame] | 221 | if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT)) |
| 222 | { |
| 223 | require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT; |
| 224 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 225 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 226 | // Load the local application controller |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 227 | // Note: The Router class automatically validates the controller path using the router->_validate_request(). |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 228 | // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. |
| 229 | if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) |
| 230 | { |
Pascal Kriete | ebb6f4b | 2010-11-10 17:09:21 -0500 | [diff] [blame] | 231 | show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 232 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 233 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 234 | include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 235 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 236 | // Set a mark point for benchmarking |
| 237 | $BM->mark('loading_time:_base_classes_end'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 238 | |
| 239 | /* |
| 240 | * ------------------------------------------------------ |
| 241 | * Security check |
| 242 | * ------------------------------------------------------ |
| 243 | * |
| 244 | * None of the functions in the app controller or the |
| 245 | * loader class can be called via the URI, nor can |
| 246 | * controller functions that begin with an underscore |
| 247 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 248 | $class = $RTR->fetch_class(); |
| 249 | $method = $RTR->fetch_method(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 250 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 251 | if ( ! class_exists($class) |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 252 | OR strncmp($method, '_', 1) == 0 |
Greg Aker | 63277b8 | 2010-11-09 13:46:13 -0600 | [diff] [blame] | 253 | OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 254 | ) |
| 255 | { |
| 256 | show_404("{$class}/{$method}"); |
| 257 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 258 | |
| 259 | /* |
| 260 | * ------------------------------------------------------ |
| 261 | * Is there a "pre_controller" hook? |
| 262 | * ------------------------------------------------------ |
| 263 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 264 | $EXT->_call_hook('pre_controller'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 265 | |
| 266 | /* |
| 267 | * ------------------------------------------------------ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 268 | * Instantiate the requested controller |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 269 | * ------------------------------------------------------ |
| 270 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 271 | // Mark a start point so we can benchmark the controller |
| 272 | $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 273 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 274 | $CI = new $class(); |
| 275 | |
| 276 | /* |
| 277 | * ------------------------------------------------------ |
| 278 | * Is there a "post_controller_constructor" hook? |
| 279 | * ------------------------------------------------------ |
| 280 | */ |
| 281 | $EXT->_call_hook('post_controller_constructor'); |
| 282 | |
| 283 | /* |
| 284 | * ------------------------------------------------------ |
| 285 | * Call the requested method |
| 286 | * ------------------------------------------------------ |
| 287 | */ |
| 288 | // Is there a "remap" function? If so, we call it instead |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 289 | if (method_exists($CI, '_remap')) |
| 290 | { |
Pascal Kriete | 3431ae3 | 2010-11-09 15:19:50 -0500 | [diff] [blame] | 291 | $CI->_remap($method, array_slice($URI->rsegments, 2)); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 292 | } |
| 293 | else |
| 294 | { |
| 295 | // is_callable() returns TRUE on some versions of PHP 5 for private and protected |
| 296 | // methods, so we'll use this workaround for consistent behavior |
| 297 | if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) |
| 298 | { |
| 299 | show_404("{$class}/{$method}"); |
| 300 | } |
| 301 | |
| 302 | // Call the requested method. |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 303 | // Any URI segments present (besides the class/function) will be passed to the method for convenience |
| 304 | call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 305 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 306 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 307 | |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 308 | // Mark a benchmark end point |
| 309 | $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 310 | |
| 311 | /* |
| 312 | * ------------------------------------------------------ |
| 313 | * Is there a "post_controller" hook? |
| 314 | * ------------------------------------------------------ |
| 315 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 316 | $EXT->_call_hook('post_controller'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 317 | |
| 318 | /* |
| 319 | * ------------------------------------------------------ |
| 320 | * Send the final rendered output to the browser |
| 321 | * ------------------------------------------------------ |
| 322 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 323 | if ($EXT->_call_hook('display_override') === FALSE) |
| 324 | { |
| 325 | $OUT->_display(); |
| 326 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 327 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 328 | /* |
| 329 | * ------------------------------------------------------ |
| 330 | * Is there a "post_system" hook? |
| 331 | * ------------------------------------------------------ |
| 332 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 333 | $EXT->_call_hook('post_system'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 334 | |
| 335 | /* |
| 336 | * ------------------------------------------------------ |
| 337 | * Close the DB connection if one exists |
| 338 | * ------------------------------------------------------ |
| 339 | */ |
Derek Jones | 218876c | 2010-03-02 13:11:00 -0600 | [diff] [blame] | 340 | if (class_exists('CI_DB') AND isset($CI->db)) |
| 341 | { |
| 342 | $CI->db->close(); |
| 343 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 344 | |
| 345 | |
| 346 | /* End of file CodeIgniter.php */ |
Derek Jones | c68dfbf | 2010-03-02 12:59:23 -0600 | [diff] [blame] | 347 | /* Location: ./system/core/CodeIgniter.php */ |