@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Start the timer... tick tock tick tock... |
186 | 186 | * ------------------------------------------------------ |
187 | 187 | */ |
188 | - $BM =& load_class('Benchmark', 'core'); |
|
188 | + $BM = & load_class('Benchmark', 'core'); |
|
189 | 189 | CIPHPUnitTestSuperGlobal::set_Global('BM', $BM); |
190 | 190 | $BM->mark('total_execution_time_start'); |
191 | 191 | $BM->mark('loading_time:_base_classes_start'); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * Instantiate the hooks class |
196 | 196 | * ------------------------------------------------------ |
197 | 197 | */ |
198 | - $EXT =& load_class('Hooks', 'core'); |
|
198 | + $EXT = & load_class('Hooks', 'core'); |
|
199 | 199 | CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT); |
200 | 200 | |
201 | 201 | /* |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * depending on another class that uses it. |
216 | 216 | * |
217 | 217 | */ |
218 | - $CFG =& load_class('Config', 'core'); |
|
218 | + $CFG = & load_class('Config', 'core'); |
|
219 | 219 | CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG); |
220 | 220 | |
221 | 221 | // Do we have any manually set config items in the index.php file? |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * Instantiate the UTF-8 class |
295 | 295 | * ------------------------------------------------------ |
296 | 296 | */ |
297 | - $UNI =& load_class('Utf8', 'core'); |
|
297 | + $UNI = & load_class('Utf8', 'core'); |
|
298 | 298 | CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI); |
299 | 299 | |
300 | 300 | /* |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * Instantiate the URI class |
303 | 303 | * ------------------------------------------------------ |
304 | 304 | */ |
305 | - $URI =& load_class('URI', 'core'); |
|
305 | + $URI = & load_class('URI', 'core'); |
|
306 | 306 | CIPHPUnitTestSuperGlobal::set_Global('URI', $URI); |
307 | 307 | |
308 | 308 | /* |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * Instantiate the routing class and set the routing |
311 | 311 | * ------------------------------------------------------ |
312 | 312 | */ |
313 | - $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
313 | + $RTR = & load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
314 | 314 | CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR); |
315 | 315 | |
316 | 316 | /* |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * Instantiate the output class |
319 | 319 | * ------------------------------------------------------ |
320 | 320 | */ |
321 | - $OUT =& load_class('Output', 'core'); |
|
321 | + $OUT = & load_class('Output', 'core'); |
|
322 | 322 | CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT); |
323 | 323 | |
324 | 324 | /* |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | * Load the security class for xss and csrf support |
337 | 337 | * ----------------------------------------------------- |
338 | 338 | */ |
339 | - $SEC =& load_class('Security', 'core'); |
|
339 | + $SEC = & load_class('Security', 'core'); |
|
340 | 340 | CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC); |
341 | 341 | |
342 | 342 | /* |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | * Load the Input class and sanitize globals |
345 | 345 | * ------------------------------------------------------ |
346 | 346 | */ |
347 | - $IN =& load_class('Input', 'core'); |
|
347 | + $IN = & load_class('Input', 'core'); |
|
348 | 348 | CIPHPUnitTestSuperGlobal::set_Global('IN', $IN); |
349 | 349 | |
350 | 350 | /* |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * Load the Language class |
353 | 353 | * ------------------------------------------------------ |
354 | 354 | */ |
355 | - $LANG =& load_class('Lang', 'core'); |
|
355 | + $LANG = & load_class('Lang', 'core'); |
|
356 | 356 | CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG); |
357 | 357 | |
358 | 358 | /* |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function &get_instance() |
377 | 377 | { |
378 | - if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
378 | + if ( ! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
379 | 379 | { |
380 | 380 | return CI_Controller::get_instance(); |
381 | 381 | } |
@@ -169,12 +169,10 @@ discard block |
||
169 | 169 | file_exists(APPPATH.'vendor/autoload.php') |
170 | 170 | ? require_once(APPPATH.'vendor/autoload.php') |
171 | 171 | : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); |
172 | - } |
|
173 | - elseif (file_exists($composer_autoload)) |
|
172 | + } elseif (file_exists($composer_autoload)) |
|
174 | 173 | { |
175 | 174 | require_once($composer_autoload); |
176 | - } |
|
177 | - else |
|
175 | + } else |
|
178 | 176 | { |
179 | 177 | log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); |
180 | 178 | } |
@@ -253,8 +251,7 @@ discard block |
||
253 | 251 | // This is required for mb_convert_encoding() to strip invalid characters. |
254 | 252 | // That's utilized by CI_Utf8, but it's also done for consistency with iconv. |
255 | 253 | mb_substitute_character('none'); |
256 | - } |
|
257 | - else |
|
254 | + } else |
|
258 | 255 | { |
259 | 256 | define('MB_ENABLED', FALSE); |
260 | 257 | } |
@@ -267,8 +264,7 @@ discard block |
||
267 | 264 | // iconv.internal_encoding is deprecated starting with PHP 5.6 |
268 | 265 | // and it's usage triggers E_DEPRECATED messages. |
269 | 266 | @ini_set('iconv.internal_encoding', $charset); |
270 | - } |
|
271 | - else |
|
267 | + } else |
|
272 | 268 | { |
273 | 269 | define('ICONV_ENABLED', FALSE); |
274 | 270 | } |
@@ -378,8 +374,7 @@ discard block |
||
378 | 374 | if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
379 | 375 | { |
380 | 376 | return CI_Controller::get_instance(); |
381 | - } |
|
382 | - else |
|
377 | + } else |
|
383 | 378 | { |
384 | 379 | return CI::$APP; |
385 | 380 | } |
@@ -424,16 +419,14 @@ discard block |
||
424 | 419 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
425 | 420 | { |
426 | 421 | $e404 = TRUE; |
427 | - } |
|
428 | - else |
|
422 | + } else |
|
429 | 423 | { |
430 | 424 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
431 | 425 | |
432 | 426 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
433 | 427 | { |
434 | 428 | $e404 = TRUE; |
435 | - } |
|
436 | - elseif (method_exists($class, '_remap')) |
|
429 | + } elseif (method_exists($class, '_remap')) |
|
437 | 430 | { |
438 | 431 | $params = array($method, array_slice($URI->rsegments, 2)); |
439 | 432 | $method = '_remap'; |
@@ -475,8 +468,7 @@ discard block |
||
475 | 468 | $RTR->directory = ''; |
476 | 469 | } |
477 | 470 | } |
478 | - } |
|
479 | - else |
|
471 | + } else |
|
480 | 472 | { |
481 | 473 | $e404 = FALSE; |
482 | 474 | } |
@@ -492,8 +484,7 @@ discard block |
||
492 | 484 | 1 => $class, |
493 | 485 | 2 => $method |
494 | 486 | ); |
495 | - } |
|
496 | - else |
|
487 | + } else |
|
497 | 488 | { |
498 | 489 | show_404($RTR->directory.$class.'/'.$method); |
499 | 490 | } |