From b183ece10dcde599c04af412f0f5c1c776ed29d8 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Fri, 26 Aug 2011 14:42:52 -0400 Subject: Changed CI_VERSION to represent develop branch --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0a1391d18..aca4fb23c 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -39,7 +39,7 @@ * @var string * */ - define('CI_VERSION', '2.0.2'); + define('CI_VERSION', '2.1.0-dev'); /** * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) -- cgit v1.2.3-24-g4f1b From f6faa536b11f2ded3973a3e976938e99537ba16a Mon Sep 17 00:00:00 2001 From: freewil Date: Thu, 29 Sep 2011 21:57:27 -0400 Subject: cleanup docblocks, remove dated CI_CORE constant --- system/core/CodeIgniter.php | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index aca4fb23c..9f88384b1 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -33,28 +33,8 @@ * @var string * */ - /** - * CodeIgniter Version - * - * @var string - * - */ define('CI_VERSION', '2.1.0-dev'); -/** - * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) - * - * @var boolean - * - */ - /** - * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) - * - * @var string - * - */ - define('CI_CORE', FALSE); - /* * ------------------------------------------------------ * Load the global functions -- cgit v1.2.3-24-g4f1b From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/core/CodeIgniter.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9f88384b1..4d76a5587 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage codeigniter * @category Front-controller - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/ */ @@ -33,7 +45,7 @@ * @var string * */ - define('CI_VERSION', '2.1.0-dev'); + define('CI_VERSION', '3.0-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 796b2b711f22775ef8e2a578bd71d065f9800442 Mon Sep 17 00:00:00 2001 From: Jack Webb-Heller Date: Thu, 1 Dec 2011 11:56:12 +0000 Subject: CodeIgniter ignores the set config value for Maximum Execution Time, overwriting it with its own value of 300 seconds. Whilst this is sensible in the vast majority of situations (browsers), when running a script from CLI, it is likely that execution times may need to be longer. Therefore, don't override the time limit if being run from the CLI - instead default back to PHP's own configuration. --- system/core/CodeIgniter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 4d76a5587..abdbf91d8 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -106,9 +106,13 @@ * Set a liberal script execution time limit * ------------------------------------------------------ */ - if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) + if (function_exists("set_time_limit") AND @ini_get("safe_mode") == 0) { - @set_time_limit(300); + // Do not override the Time Limit value if running from Command Line + if(php_sapi_name() != 'cli' && ! empty($_SERVER['REMOTE_ADDR'])) + { + @set_time_limit(300); + } } /* -- cgit v1.2.3-24-g4f1b From eea0cbebc48d156f74c044f9932602d051eb9401 Mon Sep 17 00:00:00 2001 From: Jack Webb-Heller Date: Thu, 1 Dec 2011 13:37:08 +0000 Subject: Removed `$_SERVER['REMOTE_ADDR']` following feedback --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index abdbf91d8..97527e5ca 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -109,7 +109,7 @@ if (function_exists("set_time_limit") AND @ini_get("safe_mode") == 0) { // Do not override the Time Limit value if running from Command Line - if(php_sapi_name() != 'cli' && ! empty($_SERVER['REMOTE_ADDR'])) + if(php_sapi_name() != 'cli') { @set_time_limit(300); } -- cgit v1.2.3-24-g4f1b From 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 25 Dec 2011 01:24:29 -0600 Subject: Abstracting the loading of files in the config directory depending on environments. --- system/core/CodeIgniter.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 97527e5ca..04f346c7c 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -59,14 +59,7 @@ * Load the framework constants * ------------------------------------------------------ */ - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) - { - require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); - } - else - { - require(APPPATH.'config/constants.php'); - } + load_environ_config('constants', TRUE); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From d96f88277c1e9a4c069c2e2ee3d779385549f31a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 27 Dec 2011 16:23:47 -0600 Subject: Revert "Abstracting the loading of files in the config directory depending on environments." This reverts commit 5c1aa631c5f5ec2f6b75ba1158178418e50ba11a. --- system/core/CodeIgniter.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 04f346c7c..97527e5ca 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -59,7 +59,14 @@ * Load the framework constants * ------------------------------------------------------ */ - load_environ_config('constants', TRUE); + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) + { + require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); + } + else + { + require(APPPATH.'config/constants.php'); + } /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 97527e5ca..5152073d5 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 9c5c24a582b32659c89f74fb5f773d06db23e426 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 7 Jan 2012 18:51:21 +0200 Subject: Improve core/CodeIgniter.php --- system/core/CodeIgniter.php | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 5152073d5..e3d818825 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -1,13 +1,13 @@ -_call_hook('cache_override') === FALSE) + if ($EXT->_call_hook('cache_override') === FALSE + AND $OUT->_display_cache($CFG, $URI) == TRUE) { - if ($OUT->_display_cache($CFG, $URI) == TRUE) - { - exit; - } + exit; } /* @@ -273,13 +267,13 @@ $method = $RTR->fetch_method(); if ( ! class_exists($class) - OR strncmp($method, '_', 1) == 0 + OR strpos($method, '_', 1) === 0 OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) ) { if ( ! empty($RTR->routes['404_override'])) { - $x = explode('/', $RTR->routes['404_override']); + $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; $method = (isset($x[1]) ? $x[1] : 'index'); if ( ! class_exists($class)) @@ -341,7 +335,7 @@ // Check and see if we are using a 404 override and use it. if ( ! empty($RTR->routes['404_override'])) { - $x = explode('/', $RTR->routes['404_override']); + $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; $method = (isset($x[1]) ? $x[1] : 'index'); if ( ! class_exists($class)) @@ -367,7 +361,6 @@ call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); } - // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); @@ -405,6 +398,5 @@ $CI->db->close(); } - /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file +/* Location: ./system/core/CodeIgniter.php */ -- cgit v1.2.3-24-g4f1b From 29ce5d90b4276fc8a4e9354c1435963111f09a24 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 8 Jan 2012 04:43:31 +0200 Subject: Replace AND with && --- system/core/CodeIgniter.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index e3d818825..cb5d439bd 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -59,7 +59,7 @@ * Load the framework constants * ------------------------------------------------------ */ - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) + if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) { require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } @@ -96,7 +96,7 @@ * Note: Since the config file data is cached it doesn't * hurt to load it here. */ - if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '') + if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] != '') { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } @@ -106,8 +106,8 @@ * Set a liberal script execution time limit * ------------------------------------------------------ */ - if (function_exists('set_time_limit') AND @ini_get('safe_mode') == 0 - AND php_sapi_name() !== 'cli') // Do not override the Time Limit value if running from Command Line + if (function_exists('set_time_limit') && @ini_get('safe_mode') == 0 + && php_sapi_name() !== 'cli') // Do not override the Time Limit value if running from Command Line { @set_time_limit(300); } @@ -195,7 +195,7 @@ * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE - AND $OUT->_display_cache($CFG, $URI) == TRUE) + && $OUT->_display_cache($CFG, $URI) == TRUE) { exit; } @@ -393,7 +393,7 @@ * Close the DB connection if one exists * ------------------------------------------------------ */ - if (class_exists('CI_DB') AND isset($CI->db)) + if (class_exists('CI_DB') && isset($CI->db)) { $CI->db->close(); } -- cgit v1.2.3-24-g4f1b From 176b363e534da12a38a75c9e2ba273846dfa35a7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 10 Jan 2012 18:14:28 +0200 Subject: Fix a bug in system/core/CodeIgniter.php --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index cb5d439bd..7af3c485d 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -267,7 +267,7 @@ $method = $RTR->fetch_method(); if ( ! class_exists($class) - OR strpos($method, '_', 1) === 0 + OR strpos($method, '_') === 0 OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) ) { -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 7af3c485d..a79a69590 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From a5dd2976044b856a875d50e612a2b39ae05787ea Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 14:43:01 +0300 Subject: Make _initialize() a constructor and rename _call_hook() to call_hook in the Hooks class --- system/core/CodeIgniter.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index a79a69590..4885f310c 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -133,7 +133,7 @@ * Is there a "pre_system" hook? * ------------------------------------------------------ */ - $EXT->_call_hook('pre_system'); + $EXT->call_hook('pre_system'); /* * ------------------------------------------------------ @@ -194,7 +194,7 @@ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ - if ($EXT->_call_hook('cache_override') === FALSE + if ($EXT->call_hook('cache_override') === FALSE && $OUT->_display_cache($CFG, $URI) == TRUE) { exit; @@ -297,7 +297,7 @@ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ - $EXT->_call_hook('pre_controller'); + $EXT->call_hook('pre_controller'); /* * ------------------------------------------------------ @@ -314,7 +314,7 @@ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ - $EXT->_call_hook('post_controller_constructor'); + $EXT->call_hook('post_controller_constructor'); /* * ------------------------------------------------------ @@ -369,14 +369,14 @@ * Is there a "post_controller" hook? * ------------------------------------------------------ */ - $EXT->_call_hook('post_controller'); + $EXT->call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ - if ($EXT->_call_hook('display_override') === FALSE) + if ($EXT->call_hook('display_override') === FALSE) { $OUT->_display(); } @@ -386,7 +386,7 @@ * Is there a "post_system" hook? * ------------------------------------------------------ */ - $EXT->_call_hook('post_system'); + $EXT->call_hook('post_system'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From ad4750509885ad5bb368fc308f86d8c06d45b15c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 19 Apr 2012 13:21:06 -0400 Subject: Normalize comments in core files --- system/core/CodeIgniter.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 4885f310c..9714d095c 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -230,6 +230,13 @@ // Load the base controller class require BASEPATH.'core/Controller.php'; + /** + * Reference to the CI_Controller method. + * + * Returns current CI instance object + * + * @return object + */ function &get_instance() { return CI_Controller::get_instance(); -- cgit v1.2.3-24-g4f1b From b3f774bbbb81293326136e3e13297c3b8d49dfa4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 23 Apr 2012 12:57:57 +0300 Subject: Fix issue #1265 --- system/core/CodeIgniter.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 4885f310c..92187fa16 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -275,12 +275,12 @@ { $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; - $method = (isset($x[1]) ? $x[1] : 'index'); + $method = isset($x[1]) ? $x[1] : 'index'; if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } include_once(APPPATH.'controllers/'.$class.'.php'); @@ -288,7 +288,7 @@ } else { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } } @@ -337,12 +337,12 @@ { $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; - $method = (isset($x[1]) ? $x[1] : 'index'); + $method = isset($x[1]) ? $x[1] : 'index'; if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } include_once(APPPATH.'controllers/'.$class.'.php'); @@ -352,7 +352,7 @@ } else { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } } @@ -393,10 +393,10 @@ * Close the DB connection if one exists * ------------------------------------------------------ */ - if (class_exists('CI_DB') && isset($CI->db)) + if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect) { $CI->db->close(); } /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 31d30bcf206ed2e9168b93f74511708d6bc4b505 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 23 Apr 2012 08:58:42 -0400 Subject: Merge upstream --- system/core/CodeIgniter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9714d095c..7deccd048 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * System Initialization File * @@ -406,4 +404,4 @@ } /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 48a7fbbeb53e82e9298036d40c42ec2564699ed0 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 23 Apr 2012 11:58:16 -0400 Subject: Use tabs to separate class properties --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 293582243..793c4687e 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -40,7 +40,7 @@ /** * CodeIgniter Version * - * @var string + * @var string * */ define('CI_VERSION', '3.0-dev'); -- cgit v1.2.3-24-g4f1b From 827b3f0f6fa3fd62f0276908f38d23a4165f0f41 Mon Sep 17 00:00:00 2001 From: Chris Berthe Date: Fri, 27 Apr 2012 23:36:54 -0400 Subject: Important spelling fix to CodeIgniter.php file --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 793c4687e..349f9f2d0 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -153,7 +153,7 @@ * * Note: Order here is rather important as the UTF-8 * class needs to be used very early on, but it cannot - * properly determine if UTf-8 can be supported until + * properly determine if UTF-8 can be supported until * after the Config class is instantiated. * */ -- cgit v1.2.3-24-g4f1b From 92ebfb65ac044f5c2e6d88fba137253854cf1b94 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 12:49:24 +0300 Subject: Cleanup the core classes --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 349f9f2d0..00db6e13a 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -31,7 +31,7 @@ * Loads the base classes and executes the request. * * @package CodeIgniter - * @subpackage codeigniter + * @subpackage CodeIgniter * @category Front-controller * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/ -- cgit v1.2.3-24-g4f1b From 7d22f0adbe5df5c93ae1ee367acad7568d555f0a Mon Sep 17 00:00:00 2001 From: Pawel Decowski Date: Thu, 17 May 2012 15:06:25 +0200 Subject: Remove set_time_limit() call. CodeIgniter should respect php.ini setting. --- system/core/CodeIgniter.php | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 00db6e13a..e1892ee7e 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -99,17 +99,6 @@ get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } -/* - * ------------------------------------------------------ - * Set a liberal script execution time limit - * ------------------------------------------------------ - */ - if (function_exists('set_time_limit') && @ini_get('safe_mode') == 0 - && php_sapi_name() !== 'cli') // Do not override the Time Limit value if running from Command Line - { - @set_time_limit(300); - } - /* * ------------------------------------------------------ * Start the timer... tick tock tick tock... -- cgit v1.2.3-24-g4f1b From 36237d8305260282b46f52f9fec91b5b7176088f Mon Sep 17 00:00:00 2001 From: Root Date: Mon, 21 May 2012 18:30:00 -0400 Subject: Move closing of database connection to CI_DB_driver->__destruct - #1376 --- system/core/CodeIgniter.php | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 00db6e13a..585bb7b31 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -393,15 +393,5 @@ */ $EXT->call_hook('post_system'); -/* - * ------------------------------------------------------ - * Close the DB connection if one exists - * ------------------------------------------------------ - */ - if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect) - { - $CI->db->close(); - } - /* End of file CodeIgniter.php */ /* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ed944a3c70a0bad158cd5a6ca5ce1f2e717aff5d Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:07:47 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/core --- system/core/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c8245fcfa..182f17ab3 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -94,7 +94,7 @@ * Note: Since the config file data is cached it doesn't * hurt to load it here. */ - if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] != '') + if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] !== '') { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } @@ -182,7 +182,7 @@ * ------------------------------------------------------ */ if ($EXT->call_hook('cache_override') === FALSE - && $OUT->_display_cache($CFG, $URI) == TRUE) + && $OUT->_display_cache($CFG, $URI) === TRUE) { exit; } -- cgit v1.2.3-24-g4f1b From 9ba661b02c492e89028e5c67b7edbfc0efefc9f1 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 4 Jun 2012 14:44:34 +0300 Subject: Revert/optimize some changes from ed944a3c70a0bad158cd5a6ca5ce1f2e717aff5d --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 182f17ab3..b3e984d4d 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -94,7 +94,7 @@ * Note: Since the config file data is cached it doesn't * hurt to load it here. */ - if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] !== '') + if ( ! empty($assign_to_config['subclass_prefix'])) { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } -- cgit v1.2.3-24-g4f1b From 24bd230337cc469941dbdb51e05351cc1b3fbe14 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 5 Jun 2012 22:29:12 +0300 Subject: Fix a magic_quotes-related bug and changed the default parameter value for is_php() --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index b3e984d4d..50eae8fb1 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -73,7 +73,7 @@ */ set_error_handler('_exception_handler'); - if ( ! is_php('5.3')) + if ( ! is_php('5.4')) { @set_magic_quotes_runtime(0); // Kill magic quotes } -- cgit v1.2.3-24-g4f1b From e6e6eff842ce4314b9ae7f1442579a1dba355e8d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 6 Jun 2012 00:24:57 +0300 Subject: Replace set_magic_quotes_runtime() with an ini_set() call --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 50eae8fb1..8159b19f5 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -75,7 +75,7 @@ if ( ! is_php('5.4')) { - @set_magic_quotes_runtime(0); // Kill magic quotes + @ini_set('magic_quotes_runtime', 0); // Kill magic quotes } /* -- cgit v1.2.3-24-g4f1b From 0d2c06ea1d96ea3f35dd1e7856977a24cec43233 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2012 02:33:45 +0300 Subject: Change file permissions for system/core/*.php and system/database/DB.php so that they don't differ from the rest --- system/core/CodeIgniter.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 system/core/CodeIgniter.php (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php old mode 100755 new mode 100644 -- cgit v1.2.3-24-g4f1b From a52c775d490fede2a0cb7f54f0dcc5010d7e0465 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 11 Oct 2012 10:54:02 +0300 Subject: Replace a few require() uses with require_once() (should fix issue #1872) --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 8159b19f5..f3592eaf9 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -50,7 +50,7 @@ * Load the global functions * ------------------------------------------------------ */ - require(BASEPATH.'core/Common.php'); + require_once(BASEPATH.'core/Common.php'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 5232ba07752ffa783d03754c3a869d9f73ccae69 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 27 Oct 2012 15:25:05 +0300 Subject: Docblock improvements to the Config library and remove CI_Config::_assign_to_config() Existance of _assign_to_config() is pointless as this method consists just of a foreach calling CI_Config::set_item() and is only called by CodeIgniter.php - moved that foreach() in there instead. --- system/core/CodeIgniter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f3592eaf9..324b4d849 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -130,9 +130,12 @@ $CFG =& load_class('Config', 'core'); // Do we have any manually set config items in the index.php file? - if (isset($assign_to_config)) + if (isset($assign_to_config) && is_array($assign_to_config)) { - $CFG->_assign_to_config($assign_to_config); + foreach ($assign_to_config as $key => $value) + { + $CFG->set_item($key, $value); + } } /* -- cgit v1.2.3-24-g4f1b From a5779d0a9ad598da8647e033ef8d88c3ac81fa02 Mon Sep 17 00:00:00 2001 From: vkeranov Date: Sat, 27 Oct 2012 18:04:54 +0300 Subject: Remove extra new lines --- system/core/CodeIgniter.php | 1 - 1 file changed, 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 324b4d849..f27086386 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -232,7 +232,6 @@ return CI_Controller::get_instance(); } - if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php')) { require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/core/CodeIgniter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f27086386..ee1e9b9c9 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -1,4 +1,4 @@ - Date: Fri, 2 Nov 2012 04:37:34 +0200 Subject: Router-related optimizations An improved version of changes suggesed in PR #1352, and more specifically: https://github.com/sourcejedi/CodeIgniter/commit/8f7d2dfe42bd8543981c0f295e391e433d82fd42 https://github.com/sourcejedi/CodeIgniter/commit/d2de251c092d9d822fc4898e3681b64e9c74dd2a (thanks again @sourcejedi) --- system/core/CodeIgniter.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index ee1e9b9c9..633be7fab 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -256,17 +256,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * Security check * ------------------------------------------------------ * - * None of the functions in the app controller or the + * None of the methods in the app controller or the * loader class can be called via the URI, nor can - * controller functions that begin with an underscore + * controller functions that begin with an underscore. */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); - if ( ! class_exists($class) - OR strpos($method, '_') === 0 - OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) - ) + if ( ! class_exists($class) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) { if ( ! empty($RTR->routes['404_override'])) { @@ -325,9 +322,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else { - // is_callable() returns TRUE on some versions of PHP 5 for private and protected - // methods, so we'll use this workaround for consistent behavior - if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) + if ( ! is_callable(array($CI, $method))) { // Check and see if we are using a 404 override and use it. if ( ! empty($RTR->routes['404_override'])) -- cgit v1.2.3-24-g4f1b From 533bf2dd5f36e277a9ee6629ccd667a32b05d154 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Nov 2012 22:44:29 +0200 Subject: Fix a directory/404_override bug and some routing-related optimizations --- system/core/CodeIgniter.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 633be7fab..12747c5d9 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -267,9 +267,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { if ( ! empty($RTR->routes['404_override'])) { - $x = explode('/', $RTR->routes['404_override'], 2); - $class = $x[0]; - $method = isset($x[1]) ? $x[1] : 'index'; + if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) + { + $method = 'index'; + } + if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) @@ -327,9 +329,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // Check and see if we are using a 404 override and use it. if ( ! empty($RTR->routes['404_override'])) { - $x = explode('/', $RTR->routes['404_override'], 2); - $class = $x[0]; - $method = isset($x[1]) ? $x[1] : 'index'; + if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) + { + $method = 'index'; + } + if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) -- cgit v1.2.3-24-g4f1b From 38e32f643492a7bf0233bb9848138d183fbdfcd4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 3 Nov 2012 00:16:47 +0200 Subject: Bootstrap improvements - Don't instantiate the CI singleton twice. - General clean-up. - Fix issue #953. --- system/core/CodeIgniter.php | 72 +++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 39 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 12747c5d9..1cd6403bf 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -288,6 +288,38 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } + if (method_exists($class, '_remap')) + { + $params = array($method, array_slice($URI->rsegments, 2)); + $method = '_remap'; + } + else + { + if ( ! is_callable(array($class, $method))) + { + if (empty($RTR->routes['404_override'])) + { + show_404($class.'/'.$method); + } + elseif (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) + { + $method = 'index'; + } + + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + { + show_404($class.'/'.$method); + } + + include_once(APPPATH.'controllers/'.$class.'.php'); + } + } + + $params = array_slice($URI->rsegments, 2); + } + /* * ------------------------------------------------------ * Is there a "pre_controller" hook? @@ -317,45 +349,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * Call the requested method * ------------------------------------------------------ */ - // Is there a "remap" function? If so, we call it instead - if (method_exists($CI, '_remap')) - { - $CI->_remap($method, array_slice($URI->rsegments, 2)); - } - else - { - if ( ! is_callable(array($CI, $method))) - { - // Check and see if we are using a 404 override and use it. - if ( ! empty($RTR->routes['404_override'])) - { - if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) - { - $method = 'index'; - } - - if ( ! class_exists($class)) - { - if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) - { - show_404($class.'/'.$method); - } - - include_once(APPPATH.'controllers/'.$class.'.php'); - unset($CI); - $CI = new $class(); - } - } - else - { - show_404($class.'/'.$method); - } - } - - // Call the requested method. - // Any URI segments present (besides the class/function) will be passed to the method for convenience - call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); - } + call_user_func_array(array(&$CI, $method), $params); // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); -- cgit v1.2.3-24-g4f1b From 522c73623b46afc9082ac7c8af5c34bf1b4f47f4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Nov 2012 16:40:32 +0200 Subject: Revert usage of is_callable() in system/core/CodeIgniter.php Seems to be causing issues (see #1970). Also updated the Controller docs, mainly to include an important note related to #1967. --- system/core/CodeIgniter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 1cd6403bf..89081b572 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -295,7 +295,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else { - if ( ! is_callable(array($class, $method))) + // WARNING: It appears that there are issues with is_callable() even in PHP 5.2! + // Furthermore, there are bug reports and feature/change requests related to it + // that make it unreliable to use in this context. Please, DO NOT change this + // work-around until a better alternative is available. + if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE)) { if (empty($RTR->routes['404_override'])) { -- cgit v1.2.3-24-g4f1b From 80500afbd188600212ca913a7bac073009feac73 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Jan 2013 08:16:53 +0200 Subject: [ci skip] Happy new year --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 89081b572..8affde64d 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From db529ca1e13e9f9e1c73be20c3b92a7adc3c6aa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Jan 2013 11:00:02 +0200 Subject: Remove unnecessary defined('ENVIRONMENT') checks As suggested in issue #2134 & PR #2149 --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 8affde64d..cb4b735d5 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -58,7 +58,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * Load the framework constants * ------------------------------------------------------ */ - if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) { require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } -- cgit v1.2.3-24-g4f1b From 49e68de96b420a444c826995746a5f09470e76d9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 21 Feb 2013 16:30:55 +0200 Subject: Disable autoloader call from class_exists() occurences to improve performance Note: The Driver libary tests seem to depend on that, so one occurence in CI_Loader is left until we resolve that. --- system/core/CodeIgniter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index cb4b735d5..7f76977b5 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -263,7 +263,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); - if ( ! class_exists($class) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) + if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) { if ( ! empty($RTR->routes['404_override'])) { @@ -272,7 +272,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $method = 'index'; } - if ( ! class_exists($class)) + if ( ! class_exists($class, FALSE)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { @@ -310,7 +310,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $method = 'index'; } - if ( ! class_exists($class)) + if ( ! class_exists($class, FALSE)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { -- cgit v1.2.3-24-g4f1b From 0e4237f8fb01320fb7cc87b1fb93a552630505d6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 4 Apr 2013 16:53:21 +0300 Subject: Fix #2380 and deprecate CI_Router::fetch_*() methods --- system/core/CodeIgniter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 7f76977b5..3fe5c0648 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -241,12 +241,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. - if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php')) + if ( ! file_exists(APPPATH.'controllers/'.$RTR->directory.$RTR->class.'.php')) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } - include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'); + include(APPPATH.'controllers/'.$RTR->directory.$RTR->class.'.php'); // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); @@ -260,8 +260,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * loader class can be called via the URI, nor can * controller functions that begin with an underscore. */ - $class = $RTR->fetch_class(); - $method = $RTR->fetch_method(); + $class = $RTR->class; + $method = $RTR->method; if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) { -- cgit v1.2.3-24-g4f1b From 08fec7bdf846daa3dfa4114310f065294ac092fc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 19 Jul 2013 16:25:51 +0300 Subject: Router improvements - Make dashes-to-underscores URI segment replacement configurable via ['translate_uri_dashes']. - Make _set_routing() protected and move the call to the class constructor. - Remove redudant calls to set_class() and set_method(). - Clean-up/optimize the routes loading procedure. (fixes issue #2503) --- system/core/CodeIgniter.php | 1 - 1 file changed, 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 3fe5c0648..c68266408 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -165,7 +165,6 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * ------------------------------------------------------ */ $RTR =& load_class('Router', 'core'); - $RTR->_set_routing(); // Set any routing overrides that may exist in the main index file if (isset($routing)) -- cgit v1.2.3-24-g4f1b From 20292311636837e120d205e470e41826820feb46 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 22 Jul 2013 14:29:10 +0300 Subject: Change class filenames to Ucfirst --- system/core/CodeIgniter.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c68266408..a026920a4 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -240,12 +240,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. - if ( ! file_exists(APPPATH.'controllers/'.$RTR->directory.$RTR->class.'.php')) + $class = ucfirst($RTR->class); + if ( ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } - include(APPPATH.'controllers/'.$RTR->directory.$RTR->class.'.php'); + include(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); @@ -257,9 +258,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * * None of the methods in the app controller or the * loader class can be called via the URI, nor can - * controller functions that begin with an underscore. + * controller methods that begin with an underscore. */ - $class = $RTR->class; $method = $RTR->method; if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) @@ -271,6 +271,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $method = 'index'; } + $class = ucfirst($class); + if ( ! class_exists($class, FALSE)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) @@ -309,6 +311,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $method = 'index'; } + $class = ucfirst($class); + if ( ! class_exists($class, FALSE)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) -- cgit v1.2.3-24-g4f1b From 8d70c0af8f395cfa6354e4e586b156f65954fca3 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sat, 17 Aug 2013 07:31:29 +0200 Subject: Fix $replace parameter handling in get_config() Code was reached only on first function call, then short-circuited because of the reference cache. --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index a026920a4..c962fda20 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -88,7 +88,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * The subclass prefix allows CI to know if a core class is * being extended via a library in the local application * "libraries" folder. Since CI allows config items to be - * overriden via data set in the main index. php file, + * overriden via data set in the main index.php file, * before proceeding we need to know if a subclass_prefix * override exists. If so, we will set this value now, * before any classes are loaded -- cgit v1.2.3-24-g4f1b From 21fe9daf1cdc86cbd8800515166e19b2f8879b71 Mon Sep 17 00:00:00 2001 From: Kaiwang Chen Date: Wed, 11 Sep 2013 13:09:41 +0800 Subject: Simulate a complete custom exception handler by redirecting uncaught events. --- system/core/CodeIgniter.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c962fda20..67c94cfd1 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -73,6 +73,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * ------------------------------------------------------ */ set_error_handler('_exception_handler'); + register_shutdown_function('_shutdown_handler'); if ( ! is_php('5.4')) { -- cgit v1.2.3-24-g4f1b From 5932a7354bf46fb0a86794af37da42f715c355bf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 13 Sep 2013 14:45:53 +0300 Subject: Improvements to safe_mode detection (it doesn't exist in PHP 5.4) --- system/core/CodeIgniter.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 67c94cfd1..c12116236 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -75,10 +75,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); set_error_handler('_exception_handler'); register_shutdown_function('_shutdown_handler'); - if ( ! is_php('5.4')) - { - @ini_set('magic_quotes_runtime', 0); // Kill magic quotes - } + // Kill magic quotes + is_php('5.4') OR @ini_set('magic_quotes_runtime', 0); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 1095d118eb1242091b36c00a2824d0ae7a15c8da Mon Sep 17 00:00:00 2001 From: josephok Date: Sat, 16 Nov 2013 09:33:37 +0800 Subject: Update CodeIgniter.php require(APPPATH.'config/constants.php') should be in front of require(BASEPATH.'core/Common.php') because Common.php uses some constants defined in constants.php. --- system/core/CodeIgniter.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c12116236..1981c2649 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -45,14 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * */ define('CI_VERSION', '3.0-dev'); - -/* - * ------------------------------------------------------ - * Load the global functions - * ------------------------------------------------------ - */ - require_once(BASEPATH.'core/Common.php'); - + /* * ------------------------------------------------------ * Load the framework constants @@ -67,6 +60,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); require(APPPATH.'config/constants.php'); } +/* + * ------------------------------------------------------ + * Load the global functions + * ------------------------------------------------------ + */ + require_once(BASEPATH.'core/Common.php'); + /* * ------------------------------------------------------ * Define a custom error handler so we can log PHP errors @@ -385,4 +385,4 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $EXT->call_hook('post_system'); /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file +/* Location: ./system/core/CodeIgniter.php */ -- cgit v1.2.3-24-g4f1b From b6fbcbefc8e6e883773f8f5d447413c367da9aaa Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 17 Nov 2013 18:06:18 +0200 Subject: Always load application/config/constants.php --- system/core/CodeIgniter.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 1981c2649..45c3485bf 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -45,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * */ define('CI_VERSION', '3.0-dev'); - + /* * ------------------------------------------------------ * Load the framework constants @@ -55,10 +55,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } - else - { - require(APPPATH.'config/constants.php'); - } + + require(APPPATH.'config/constants.php'); /* * ------------------------------------------------------ @@ -385,4 +383,4 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $EXT->call_hook('post_system'); /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 4e6c5281a3258b3ff530a43580d1b8dc8e34dd59 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 10 Jan 2014 19:29:49 +0200 Subject: Finally get rid of the CI_Router::_set_overrides() calls --- system/core/CodeIgniter.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 45c3485bf..cc12f149f 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -163,12 +163,6 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ $RTR =& load_class('Router', 'core'); - // Set any routing overrides that may exist in the main index file - if (isset($routing)) - { - $RTR->_set_overrides($routing); - } - /* * ------------------------------------------------------ * Instantiate the output class -- cgit v1.2.3-24-g4f1b From 30d5324617ae136c7a91badb6ed8f7de418fd7f5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 16 Jan 2014 14:41:46 +0200 Subject: URI Routing overhaul - Allow multiple levels of controller directories (supersedes PRs #390, #2439) - Add support for per-directory 'defaul_controller' and '404_override' (resolves issue #2611; supersedes PR #939) - Fixed a bug where default_controller was called instead of triggering 404 if the current route is inside a directory - Removed a few calls from CI_Router to CI_URI that made a necessity for otherwise internal CI_URI methods to be public: - Removed CI_URI::_fetch_uri_string() and moved its logic into CI_URI::__construct() - Removed CI_URI::_remove_url_suffix, CI_URI::_explode_segments() and moved their logic into CI_URI::_set_uri_string() - Removed CI_URI::_reindex_segments() altogether ( doesn't need further manipulation, while is public anyway and can be properly (and more effectively) replaced on the spot) --- system/core/CodeIgniter.php | 143 +++++++++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 61 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index cc12f149f..74a9eb0af 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -53,10 +53,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) { - require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); + require_once(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } - require(APPPATH.'config/constants.php'); + require_once(APPPATH.'config/constants.php'); /* * ------------------------------------------------------ @@ -209,7 +209,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * */ // Load the base controller class - require BASEPATH.'core/Controller.php'; + require_once BASEPATH.'core/Controller.php'; /** * Reference to the CI_Controller method. @@ -225,96 +225,117 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php')) { - require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; + require_once APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; } - // Load the local application controller - // Note: The Router class automatically validates the controller path using the router->_validate_request(). - // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. - $class = ucfirst($RTR->class); - if ( ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) - { - show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); - } - - include(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); - // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); /* * ------------------------------------------------------ - * Security check + * Sanity checks * ------------------------------------------------------ * - * None of the methods in the app controller or the - * loader class can be called via the URI, nor can + * The Router class has already validated the request, + * leaving us with 3 options here: + * + * 1) an empty class name, if we reached the default + * controller, but it didn't exist; + * 2) a query string which doesn't go through a + * file_exists() check + * 3) a regular request for a non-existing page + * + * We handle all of these as a 404 error. + * + * Furthermore, none of the methods in the app controller + * or the loader class can be called via the URI, nor can * controller methods that begin with an underscore. */ - $method = $RTR->method; - - if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) - { - if ( ! empty($RTR->routes['404_override'])) - { - if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) - { - $method = 'index'; - } - $class = ucfirst($class); - - if ( ! class_exists($class, FALSE)) - { - if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) - { - show_404($class.'/'.$method); - } - - include_once(APPPATH.'controllers/'.$class.'.php'); - } - } - else - { - show_404($class.'/'.$method); - } - } + $e404 = FALSE; + $class = ucfirst($RTR->class); + $method = $RTR->method; - if (method_exists($class, '_remap')) + if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) { - $params = array($method, array_slice($URI->rsegments, 2)); - $method = '_remap'; + $e404 = TRUE; } else { + require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); + + if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) + { + $e404 = TRUE; + } + elseif (method_exists($class, '_remap')) + { + $params = array($method, array_slice($URI->rsegments, 2)); + $method = '_remap'; + } // WARNING: It appears that there are issues with is_callable() even in PHP 5.2! // Furthermore, there are bug reports and feature/change requests related to it // that make it unreliable to use in this context. Please, DO NOT change this // work-around until a better alternative is available. - if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE)) + elseif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE)) { - if (empty($RTR->routes['404_override'])) - { - show_404($class.'/'.$method); - } - elseif (sscanf($RTR->routes['404_override'], '%[^/]/%s', $class, $method) !== 2) + $e404 = TRUE; + } + } + + if ($e404) + { + if ( ! empty($RTR->routes['404_override'])) + { + if (sscanf($RTR->routes['404_override'], '%[^/]/%s', $error_class, $error_method) !== 2) { - $method = 'index'; + $error_method = 'index'; } - $class = ucfirst($class); + $error_class = ucfirst($error_class); - if ( ! class_exists($class, FALSE)) + if ( ! class_exists($error_class, FALSE)) { - if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + if (file_exists(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php')) { - show_404($class.'/'.$method); + require_once(APPPATH.'controllers/'.$RTR->directory.$error_class.'.php'); + $e404 = ! class_exists($error_class, FALSE); } - - include_once(APPPATH.'controllers/'.$class.'.php'); + // Were we in a directory? If so, check for a global override + elseif ( ! empty($RTR->directory) && file_exists(APPPATH.'controllers/'.$error_class.'.php')) + { + require_once(APPPATH.'controllers/'.$error_class.'.php'); + if (($e404 = ! class_exists($error_class, FALSE)) === FALSE) + { + $RTR->directory = ''; + } + } + } + else + { + $e404 = FALSE; } } + // Did we reset the $e404 flag? If so, set the rsegments, starting from index 1 + if ( ! $e404) + { + $class = $error_class; + $method = $error_method; + + $URI->rsegments = array( + 1 => $class, + 2 => $method + ); + } + else + { + show_404($RTR->directory.$class.'/'.$method); + } + } + + if ($method !== '_remap') + { $params = array_slice($URI->rsegments, 2); } -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 74a9eb0af..044b64758 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From eb555ed7a1673dab9f51df0d1365d19c4429a900 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 12 Feb 2014 19:25:01 +0200 Subject: Move mbstring/iconv configuration and MB_ENABLED, ICONV_ENABLED out of CI_Utf8::__construct() Also, use mb_substitute_character() instead of ini_set() --- system/core/CodeIgniter.php | 50 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 044b64758..70d6ca53f 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -124,6 +124,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * ------------------------------------------------------ * Instantiate the config class * ------------------------------------------------------ + * + * Note: It is important that Config is loaded first as + * most other classes depend on it either directly or by + * depending on another class that uses it. + * */ $CFG =& load_class('Config', 'core'); @@ -138,14 +143,49 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /* * ------------------------------------------------------ - * Instantiate the UTF-8 class + * Important charset-related stuff * ------------------------------------------------------ * - * Note: Order here is rather important as the UTF-8 - * class needs to be used very early on, but it cannot - * properly determine if UTF-8 can be supported until - * after the Config class is instantiated. + * Configure mbstring and/or iconv if they are enabled + * and set MB_ENABLED and ICONV_ENABLED constants, so + * that we don't repeatedly do extension_loaded() or + * function_exists() calls. * + * Note: UTF-8 class depends on this. It used to be done + * in it's constructor, but it's _not_ class-specific. + * + */ + $charset = strtoupper(config_item('charset')); + + if (extension_loaded('mbstring')) + { + define('MB_ENABLED', TRUE); + mb_internal_encoding($charset); + // This is required for mb_convert_encoding() to strip invalid characters. + // That's utilized by CI_Utf8, but it's also done for consistency with iconv. + mb_substitute_character('none'); + } + else + { + define('MB_ENABLED', FALSE); + } + + // There's an ICONV_IMPL constant, but the PHP manual says that using + // iconv's predefined constants is "strongly discouraged". + if (extension_loaded('iconv')) + { + define('ICONV_ENABLED', TRUE); + iconv_set_encoding('internal_encoding', $charset); + } + else + { + define('ICONV_ENABLED', FALSE); + } + +/* + * ------------------------------------------------------ + * Instantiate the UTF-8 class + * ------------------------------------------------------ */ $UNI =& load_class('Utf8', 'core'); -- cgit v1.2.3-24-g4f1b From 3fd1b384273b7b6d56950bbad3e1fac18f5f82e4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 13 Feb 2014 03:01:31 +0200 Subject: Introducing compatibility layers - Limited support for mbstring (mb_strlen(), mb_strpos(), mb_substr() only) via iconv. Falls back to regular strlen(), strpos(), substr() if iconv is not available. - Password hashing, dependant on CRYPT_BLOWFISH (2y version, available since PHP 5.3.7) availability. --- system/core/CodeIgniter.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 70d6ca53f..270988a1b 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -182,6 +182,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); define('ICONV_ENABLED', FALSE); } +/* + * ------------------------------------------------------ + * Load compatibility features + * ------------------------------------------------------ + */ + + require_once(BASEPATH.'core/compat/mbstring.php'; + require_once(BASEPATH.'core/compat/password.php'; + /* * ------------------------------------------------------ * Instantiate the UTF-8 class -- cgit v1.2.3-24-g4f1b From 376b215500b1facb3ba063aec618bcc12da50351 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 13 Feb 2014 12:35:52 +0200 Subject: Fix syntax error --- system/core/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 270988a1b..1f10c452d 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -188,8 +188,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * ------------------------------------------------------ */ - require_once(BASEPATH.'core/compat/mbstring.php'; - require_once(BASEPATH.'core/compat/password.php'; + require_once(BASEPATH.'core/compat/mbstring.php'); + require_once(BASEPATH.'core/compat/password.php'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 9a152a91c982d5f2ba07d0197ef2fe5eb8c8510c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 18 Feb 2014 16:29:53 +0200 Subject: Add an ext/hash compatibility layer (just hash_pbkdf2(), for now) --- system/core/CodeIgniter.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 1f10c452d..2bdd76463 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -189,6 +189,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ require_once(BASEPATH.'core/compat/mbstring.php'); + require_once(BASEPATH.'core/compat/hash.php'); require_once(BASEPATH.'core/compat/password.php'); /* -- cgit v1.2.3-24-g4f1b From 02545895c1c6551be3b167bcada171fe9423d443 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 19 Feb 2014 23:49:31 +0200 Subject: Add compatibility layer for array_column(), array_replace(), array_replace_recursive() --- system/core/CodeIgniter.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 2bdd76463..eb3927e47 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -191,6 +191,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); require_once(BASEPATH.'core/compat/mbstring.php'); require_once(BASEPATH.'core/compat/hash.php'); require_once(BASEPATH.'core/compat/password.php'); + require_once(BASEPATH.'core/compat/array.php'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From ca39f2efb2d827d13e4065535355de894965435a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Feb 2014 02:30:14 +0200 Subject: Don't use error suppression with ini_set() --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index eb3927e47..6d6747106 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -74,7 +74,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); register_shutdown_function('_shutdown_handler'); // Kill magic quotes - is_php('5.4') OR @ini_set('magic_quotes_runtime', 0); + is_php('5.4') OR ini_set('magic_quotes_runtime', 0); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From c26b9ebb00e29be2e972fece3bcf73d33249a64b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 24 Feb 2014 11:31:36 +0200 Subject: Don't use globals - Use load_class() to get objects during bootstrap process. - Change load_class() to accept a class constructor parameter instead of previously unused class name prefix. - Change CI_Router::__construct() to accept as a parameter. --- system/core/CodeIgniter.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 6d6747106..df5fa3b02 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -212,7 +212,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * Instantiate the routing class and set the routing * ------------------------------------------------------ */ - $RTR =& load_class('Router', 'core'); + $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); /* * ------------------------------------------------------ @@ -226,8 +226,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ - if ($EXT->call_hook('cache_override') === FALSE - && $OUT->_display_cache($CFG, $URI) === TRUE) + if ($EXT->call_hook('cache_override') === FALSE && $OUT->_display_cache($CFG, $URI) === TRUE) { exit; } -- cgit v1.2.3-24-g4f1b From b78a8c7d40446a3e2e36772706662fd033fe7d1d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 15 Apr 2014 17:21:16 +0300 Subject: Fix #3004 --- system/core/CodeIgniter.php | 54 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index df5fa3b02..4f625b143 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -65,6 +65,57 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ require_once(BASEPATH.'core/Common.php'); + +/* + * ------------------------------------------------------ + * Security procedures + * ------------------------------------------------------ + */ + +if ( ! is_php('5.4')) +{ + ini_set('magic_quotes_runtime', 0); + + if ((bool) ini_get('register_globals')) + { + $_protected = array( + '_SERVER', + '_GET', + '_POST', + '_FILES', + '_REQUEST', + '_SESSION', + '_ENV', + '_COOKIE', + 'GLOBALS', + 'HTTP_RAW_POST_DATA', + 'system_folder', + 'application_folder', + 'view_folder', + '_protected', + '_registered' + ); + + $_registered = ini_get('variables_order'); + foreach (array('E' => '_ENV', 'G' => '_GET', 'P' => '_POST', 'C' => '_COOKIE', 'S' => '_SERVER') as $key => $superglobal) + { + if (strpos($_registered, $key) === FALSE) + { + continue; + } + + foreach (array_keys($$superglobal) as $var) + { + if (isset($GLOBALS[$var]) && ! in_array($var, $_protected, TRUE)) + { + $GLOBALS[$var] = NULL; + } + } + } + } +} + + /* * ------------------------------------------------------ * Define a custom error handler so we can log PHP errors @@ -73,9 +124,6 @@ defined('BASEPATH') OR exit('No direct script access allowed'); set_error_handler('_exception_handler'); register_shutdown_function('_shutdown_handler'); - // Kill magic quotes - is_php('5.4') OR ini_set('magic_quotes_runtime', 0); - /* * ------------------------------------------------------ * Set the subclass_prefix -- cgit v1.2.3-24-g4f1b From de70dbb64286dda89e21a52042ddef0fbbc0ebe1 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 15 Apr 2014 16:46:03 +0200 Subject: Fix in $_protected array of register_globals security procedure * Followup to b78a8c7d40446a3e2e36772706662fd033fe7d1d * Just FYI, renamed to "system_path" in 0c1e405437ceb3c1888e151e6a400653310ad6c1 --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 4f625b143..9df042f02 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -89,7 +89,7 @@ if ( ! is_php('5.4')) '_COOKIE', 'GLOBALS', 'HTTP_RAW_POST_DATA', - 'system_folder', + 'system_path', 'application_folder', 'view_folder', '_protected', -- cgit v1.2.3-24-g4f1b From 51593f49cda71bdf8400ba6555a9e1598ff21c7c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 7 May 2014 00:06:31 +0300 Subject: Account for PHP 5.6 changes related to charsets --- system/core/CodeIgniter.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9df042f02..a7118bfc7 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -204,11 +204,12 @@ if ( ! is_php('5.4')) * */ $charset = strtoupper(config_item('charset')); + ini_set('default_charset', $charset); if (extension_loaded('mbstring')) { define('MB_ENABLED', TRUE); - mb_internal_encoding($charset); + ini_set('mbstring.internal_encoding', $charset); // This is required for mb_convert_encoding() to strip invalid characters. // That's utilized by CI_Utf8, but it's also done for consistency with iconv. mb_substitute_character('none'); @@ -223,13 +224,20 @@ if ( ! is_php('5.4')) if (extension_loaded('iconv')) { define('ICONV_ENABLED', TRUE); - iconv_set_encoding('internal_encoding', $charset); + // iconv.internal_encoding is deprecated starting with PHP 5.6 + // and it's usage triggers E_DEPRECATED messages. + @ini_set('iconv.internal_encoding', $charset); } else { define('ICONV_ENABLED', FALSE); } + if (is_php('5.6')) + { + ini_set('php.internal_encoding', $charset); + } + /* * ------------------------------------------------------ * Load compatibility features -- cgit v1.2.3-24-g4f1b From 1ffa223bd3d201d00170b3376bdc099ea8f12957 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 May 2014 12:30:59 +0300 Subject: Suppress PHP 5.6 E_DEPRECATED warnings for mbstring.internal_encoding as well --- system/core/CodeIgniter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index a7118bfc7..1c6e76b4f 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -209,7 +209,9 @@ if ( ! is_php('5.4')) if (extension_loaded('mbstring')) { define('MB_ENABLED', TRUE); - ini_set('mbstring.internal_encoding', $charset); + // mbstring.internal_encoding is deprecated starting with PHP 5.6 + // and it's usage triggers E_DEPRECATED messages. + @ini_set('mbstring.internal_encoding', $charset); // This is required for mb_convert_encoding() to strip invalid characters. // That's utilized by CI_Utf8, but it's also done for consistency with iconv. mb_substitute_character('none'); -- cgit v1.2.3-24-g4f1b From 5b3fe7c4af5e08e17480b911fbfa8cf0ef6475c0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 7 Jul 2014 10:55:53 +0300 Subject: Fix a few typos and add a backport (compat) for hex2bin() --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 1c6e76b4f..3e1280bab 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -249,7 +249,7 @@ if ( ! is_php('5.4')) require_once(BASEPATH.'core/compat/mbstring.php'); require_once(BASEPATH.'core/compat/hash.php'); require_once(BASEPATH.'core/compat/password.php'); - require_once(BASEPATH.'core/compat/array.php'); + require_once(BASEPATH.'core/compat/standard.php'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From ed86ee14f3a36de1034b8fa19ff6d41aeb428a93 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 11 Jul 2014 19:48:37 +0300 Subject: Add setting ['composer_autoload'] Supersedes PR #3132 --- system/core/CodeIgniter.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 3e1280bab..5ff788ae3 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -447,6 +447,23 @@ if ( ! is_php('5.4')) $params = array_slice($URI->rsegments, 2); } +/* + * ------------------------------------------------------ + * Should we use a Composer autoloader? + * ------------------------------------------------------ + */ + if (($composer_autoload = config_item('composer_autoload')) !== FALSE) + { + if ($composer_autoload === TRUE && file_exists(APPPATH.'vendor/autoload.php')) + { + require_once(APPPATH.'vendor/autoload.php'); + } + elseif (file_exists($composer_autoload)) + { + require_once($composer_autoload); + } + } + /* * ------------------------------------------------------ * Is there a "pre_controller" hook? -- cgit v1.2.3-24-g4f1b From 286f9e1ae17188562d5f42c197709b547b90596e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 6 Oct 2014 01:54:21 +0300 Subject: Optimize the composer_autoload check --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 5ff788ae3..10d599c98 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -452,7 +452,7 @@ if ( ! is_php('5.4')) * Should we use a Composer autoloader? * ------------------------------------------------------ */ - if (($composer_autoload = config_item('composer_autoload')) !== FALSE) + if ($composer_autoload = config_item('composer_autoload')) { if ($composer_autoload === TRUE && file_exists(APPPATH.'vendor/autoload.php')) { -- cgit v1.2.3-24-g4f1b From bdb96ca1b1dbfc1791172fd169d7751cbc4d7d55 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 00:13:31 +0200 Subject: [ci skip] Switch to MIT license; close #3293 --- system/core/CodeIgniter.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 10d599c98..e3d3a1ffb 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -4,24 +4,35 @@ * * An open source application development framework for PHP 5.2.4 or newer * - * NOTICE OF LICENSE + * This content is released under the MIT License (MIT) * - * Licensed under the Open Software License version 3.0 + * Copyright (c) 2014, British Columbia Institute of Technology * - * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is - * also available through the world wide web at this URL: - * http://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to obtain it - * through the world wide web, please send an email to - * licensing@ellislab.com so we can send you a copy immediately. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * @package CodeIgniter - * @author EllisLab Dev Team + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @package CodeIgniter + * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * @link http://codeigniter.com - * @since Version 1.0 + * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @license http://opensource.org/licenses/MIT MIT License + * @link http://codeigniter.com + * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); -- cgit v1.2.3-24-g4f1b From 4b838af40d77684539dd40461bd92e6e453fe675 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 23:46:45 +0200 Subject: Add a real exception handler Close #1590 Close #3200 --- system/core/CodeIgniter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index e3d3a1ffb..88e730bc3 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -132,7 +132,8 @@ if ( ! is_php('5.4')) * Define a custom error handler so we can log PHP errors * ------------------------------------------------------ */ - set_error_handler('_exception_handler'); + set_error_handler('_error_handler'); + set_exception_handler('_exception_handler'); register_shutdown_function('_shutdown_handler'); /* -- cgit v1.2.3-24-g4f1b From 72d63cdb448284251a2fccb45f509117e45ea2b9 Mon Sep 17 00:00:00 2001 From: Claudio Galdiolo Date: Mon, 22 Dec 2014 15:18:14 -0500 Subject: fix typo in the comments --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 88e730bc3..b1da42d54 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -145,7 +145,7 @@ if ( ! is_php('5.4')) * The subclass prefix allows CI to know if a core class is * being extended via a library in the local application * "libraries" folder. Since CI allows config items to be - * overriden via data set in the main index.php file, + * overridden via data set in the main index.php file, * before proceeding we need to know if a subclass_prefix * override exists. If so, we will set this value now, * before any classes are loaded -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/core/CodeIgniter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index b1da42d54..59fdba0e5 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 4cbe463b4c442e0e2dae2f43565e77f7ac5ecb86 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 21 Jan 2015 22:56:22 +0100 Subject: Remove closing blocks at end of PHP files --- system/core/CodeIgniter.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 59fdba0e5..8c936e018 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -533,6 +533,3 @@ if ( ! is_php('5.4')) * ------------------------------------------------------ */ $EXT->call_hook('post_system'); - -/* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 17254324f9887c5fa511b94a3b17c8c4d82b2c8f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 30 Jan 2015 15:53:28 +0200 Subject: [ci skip] Load vendor/autoload.php earlier --- system/core/CodeIgniter.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 8c936e018..839caba08 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -157,6 +157,23 @@ if ( ! is_php('5.4')) get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } +/* + * ------------------------------------------------------ + * Should we use a Composer autoloader? + * ------------------------------------------------------ + */ + if ($composer_autoload = config_item('composer_autoload')) + { + if ($composer_autoload === TRUE && file_exists(APPPATH.'vendor/autoload.php')) + { + require_once(APPPATH.'vendor/autoload.php'); + } + elseif (file_exists($composer_autoload)) + { + require_once($composer_autoload); + } + } + /* * ------------------------------------------------------ * Start the timer... tick tock tick tock... @@ -459,23 +476,6 @@ if ( ! is_php('5.4')) $params = array_slice($URI->rsegments, 2); } -/* - * ------------------------------------------------------ - * Should we use a Composer autoloader? - * ------------------------------------------------------ - */ - if ($composer_autoload = config_item('composer_autoload')) - { - if ($composer_autoload === TRUE && file_exists(APPPATH.'vendor/autoload.php')) - { - require_once(APPPATH.'vendor/autoload.php'); - } - elseif (file_exists($composer_autoload)) - { - require_once($composer_autoload); - } - } - /* * ------------------------------------------------------ * Is there a "pre_controller" hook? -- cgit v1.2.3-24-g4f1b From 2eb580cff726160f737da2e36ebae7e60d676e30 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 30 Jan 2015 16:41:43 +0200 Subject: Log an error message if composer_autoload is not found. --- system/core/CodeIgniter.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 839caba08..d830c1829 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -164,14 +164,20 @@ if ( ! is_php('5.4')) */ if ($composer_autoload = config_item('composer_autoload')) { - if ($composer_autoload === TRUE && file_exists(APPPATH.'vendor/autoload.php')) + if ($composer_autoload === TRUE) { - require_once(APPPATH.'vendor/autoload.php'); + file_exists(APPPATH.'vendor/autoload.php') + ? require_once(APPPATH.'vendor/autoload.php') + : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); } elseif (file_exists($composer_autoload)) { require_once($composer_autoload); } + else + { + log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); + } } /* -- cgit v1.2.3-24-g4f1b From c0b2ae29b8a4c48c6adde72bc3f66ad3780246ec Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 31 Mar 2015 11:50:46 +0300 Subject: [ci skip] Update version number --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index d830c1829..b38166b60 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0-dev'); + define('CI_VERSION', '3.0.0'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From d75847ecf28bdbad7033af33514d042ee86c13c2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 1 Apr 2015 14:51:47 +0300 Subject: [ci skip] Update version numbers --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index b38166b60..ddf322749 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.0'); + define('CI_VERSION', '3.0.1-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 1c0f46ad96a923329d7defc92d0e7d93faf00935 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Aug 2015 14:42:29 +0300 Subject: [ci skip] Start of 3.0.2-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index ddf322749..b69630cf8 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.1-dev'); + define('CI_VERSION', '3.0.2-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 47adcef68871cea1e556ffb2c0b6f585497e2a27 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 8 Oct 2015 17:21:06 +0300 Subject: [ci skip] Prepare 3.0.2 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index b69630cf8..60dcc0e5e 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.2-dev'); + define('CI_VERSION', '3.0.2'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 2b5825ec66670b6ecb9528740cc1a51b59dbd3f2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Oct 2015 16:57:28 +0300 Subject: [ci skip] This is 3.0.3-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 60dcc0e5e..8cea813a2 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.2'); + define('CI_VERSION', '3.0.3-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 0abc55a22535586929fb146a81d1cee68dbccd10 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 31 Oct 2015 19:30:41 +0200 Subject: [ci skip] Update changelog, version & upgrade instructions --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 8cea813a2..5080dc6d1 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.3-dev'); + define('CI_VERSION', '3.0.3'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From ab3c383fb3535e55253271f210870cd9361d94c9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Nov 2015 15:40:55 +0200 Subject: [ci skip] Start of 3.0.4 development --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 5080dc6d1..79a23c4ca 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.3'); + define('CI_VERSION', '3.0.4-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 125ef4751080a2118cb203357d77687699e3eb25 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:33:00 +0200 Subject: [ci skip] Bump year to 2016 --- system/core/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 79a23c4ca..1394fd862 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology + * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From bd202c91b0e9cf0a8c93bcaa71df9574f5909346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:50:18 +0200 Subject: [ci skip] Update codeigniter.com links to https --- system/core/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 1394fd862..3b728ddae 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License - * @link http://codeigniter.com + * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ @@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage CodeIgniter * @category Front-controller * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/ + * @link https://codeigniter.com/user_guide/ */ /** -- cgit v1.2.3-24-g4f1b From 1924e879b165fb119847a49a7a5eab2f28295fa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:55:34 +0200 Subject: [ci skip] Update ellislab.com links to https too --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 3b728ddae..727f37029 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -28,7 +28,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com -- cgit v1.2.3-24-g4f1b From 4307bff0a4ae884d57cc0c0fa8f54de6c05000e7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 13 Jan 2016 02:13:10 +0200 Subject: [ci skip] Mark the start of 3.0.5 development --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 727f37029..52b542654 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.4-dev'); + define('CI_VERSION', '3.0.5-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 7e0bde27c8a6669b781d87c15ea51b750c91f97c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 7 Mar 2016 17:52:26 +0200 Subject: Merge pull request #4472 from vibbow/patch-1 [ci skip] Update get_instance() return type in docblock --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 52b542654..bf41ab2a2 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -359,7 +359,7 @@ if ( ! is_php('5.4')) * * Returns current CI instance object * - * @return object + * @return CI_Controller */ function &get_instance() { -- cgit v1.2.3-24-g4f1b From 59bcd1810f6c18e6dd4158003f122f750536d22e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 11 Mar 2016 18:23:27 +0200 Subject: [ci skip] Prepare for 3.0.5 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index bf41ab2a2..94d34c3fd 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.5-dev'); + define('CI_VERSION', '3.0.5'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 4f9b20ae507dda7379d392386fb7ce5702626a91 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 11 Mar 2016 18:35:58 +0200 Subject: [ci skip] Mark the start of 3.0.6 development --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 94d34c3fd..f0d7c8f53 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.5'); + define('CI_VERSION', '3.0.6-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 9de0f0b3a65bea6adff9999977ea6b717099e194 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Mar 2016 18:22:33 +0200 Subject: [ci skip] Prepare for 3.0.6 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f0d7c8f53..3eb3e0573 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.6-dev'); + define('CI_VERSION', '3.0.6'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From eb373a1abb348515001123ecbaca5e5384e69d19 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Mar 2016 18:30:06 +0200 Subject: [ci skip] Mark the start of 3.0.7 development --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 3eb3e0573..f0d7c8f53 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.6'); + define('CI_VERSION', '3.0.6-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 951a4d5c76a5b6403b40bcaff326cf8dbedcbca6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 22 Mar 2016 11:08:54 +0200 Subject: [ci skip] Fix CI_VERSION --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f0d7c8f53..aef0d3a5d 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.6-dev'); + define('CI_VERSION', '3.0.7-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 606ad654dcbc9f0fc30f00ce6574918790ee0d1e Mon Sep 17 00:00:00 2001 From: Claudio Galdiolo Date: Thu, 7 Jul 2016 15:32:12 -0400 Subject: Prepare for 3.1.0 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index aef0d3a5d..2525edae2 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.7-dev'); + define('CI_VERSION', '3.1.0'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 0b9540209499fbd0515e13fdc66e85dea4b6baad Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 26 Jul 2016 20:52:30 +0300 Subject: [ci skip] Mark the start of 3.1.1 development --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 2525edae2..70f33d5ed 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.1.0'); + define('CI_VERSION', '3.1.1-dev'); /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From a838279625becfba98ccb7635d35c67297129c42 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 28 Jul 2016 16:40:12 +0300 Subject: Remove dead code written for PHP 5.2 --- system/core/CodeIgniter.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 70f33d5ed..22072e983 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -416,11 +416,7 @@ if ( ! is_php('5.4')) $params = array($method, array_slice($URI->rsegments, 2)); $method = '_remap'; } - // WARNING: It appears that there are issues with is_callable() even in PHP 5.2! - // Furthermore, there are bug reports and feature/change requests related to it - // that make it unreliable to use in this context. Please, DO NOT change this - // work-around until a better alternative is available. - elseif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE)) + elseif ( ! is_callable(array($class, $method))) { $e404 = TRUE; } -- cgit v1.2.3-24-g4f1b From ca102a05b1403c573f03c4cdb7fbba15ab99fe87 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 28 Jul 2016 17:22:21 +0300 Subject: [ci skip] Use const keyword to define CI_VERSION Because. --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 22072e983..804c6856d 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.1.1-dev'); + const CI_VERSION = '3.1.1-dev'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 378627bb0e0cfb433299a6d832c18099e5c1dc9c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 22 Oct 2016 16:48:35 +0300 Subject: [ci skip] Prepare for 3.1.1 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 804c6856d..c5d26e52b 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.1-dev'; + const CI_VERSION = '3.1.1'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 9f8c00508bf5333207dbede5d61a2432b20cc4ec Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 27 Oct 2016 15:06:46 +0300 Subject: [ci skip] This is 3.1.2-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c5d26e52b..6562e99a2 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.1'; + const CI_VERSION = '3.1.2-dev'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 7bc882384ef4c442fb4edd699c8dd15bbd22e429 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 27 Oct 2016 15:41:23 +0300 Subject: Close #4875 --- system/core/CodeIgniter.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 6562e99a2..32ad61899 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -416,10 +416,29 @@ if ( ! is_php('5.4')) $params = array($method, array_slice($URI->rsegments, 2)); $method = '_remap'; } - elseif ( ! is_callable(array($class, $method))) + elseif ( ! method_exists($class, $method)) { $e404 = TRUE; } + /** + * DO NOT CHANGE THIS, NOTHING ELSE WORKS! + * + * - method_exists() returns true for non-public methods, which passes the previous elseif + * - is_callable() returns false for PHP 4-style constructors, even if there's a __construct() + * - method_exists($class, '__construct') won't work because CI_Controller::__construct() is inherited + * - People will only complain if this doesn't work, even though it is documented that it shouldn't. + * + * ReflectionMethod::isConstructor() is the ONLY reliable check, + * knowing which method will be executed as a constructor. + */ + elseif ( ! is_callable(array($class, $method)) && strcasecmp($class, $method) === 0) + { + $reflection = new ReflectionMethod($class, $method); + if ( ! $reflection->isPublic() OR $reflection->isConstructor()) + { + $e404 = TRUE; + } + } } if ($e404) -- cgit v1.2.3-24-g4f1b From a1f830dedc53e31a48c8722ed11e3e645526bdcc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 28 Oct 2016 17:59:47 +0300 Subject: [ci skip] Prepare for 3.1.2 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 32ad61899..a2067fb10 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.2-dev'; + const CI_VERSION = '3.1.2'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 499c6080cd41927df088206155e4055d4da3e58e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 28 Oct 2016 18:28:34 +0300 Subject: [ci skip] Mark the start of 3.1.3-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index a2067fb10..71656be29 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.2'; + const CI_VERSION = '3.1.3-dev'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 5d6e77b092ca8f1700a7407bf59bcab6b0e30808 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Dec 2016 17:14:35 +0200 Subject: [ci skip] Fix #4928 --- system/core/CodeIgniter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 71656be29..c9cb5c89f 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -67,7 +67,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); require_once(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } - require_once(APPPATH.'config/constants.php'); + if (file_exists(APPPATH.'config/constants.php')) + { + require_once(APPPATH.'config/constants.php'); + } /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From da60e9bc66ec90970fbd2dfd08b0a6e66b9f5f5f Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 31 Dec 2016 08:46:18 -0800 Subject: Update copyright data to 2017 --- system/core/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index c9cb5c89f..77365b1c3 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2016, British Columbia Institute of Technology + * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 52ba26b622b4e58d9511818f8625e77313d680e2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Jan 2017 16:28:56 +0200 Subject: [ci skip] Prepare 3.1.3 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 77365b1c3..0edcf972d 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.3-dev'; + const CI_VERSION = '3.1.3'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 7657600403b63d7656dce7b18d2880d3703ad57e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Jan 2017 18:55:03 +0200 Subject: [ci skip] Mark the beginning of 3.1.4-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0edcf972d..63e9563a1 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.3'; + const CI_VERSION = '3.1.4-dev'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From f58643bab5e5a868aabdaa64668cdb67a9b82fbb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Mar 2017 17:46:23 +0200 Subject: [ci skip] Prepare 3.1.4 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 63e9563a1..880abab57 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.4-dev'; + const CI_VERSION = '3.1.4'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From f83d10b375bd028480a47ec3c0bbb2b07dcabfee Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Mar 2017 17:55:38 +0200 Subject: [ci skip] Mark the start of 3.1.5-dev --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 880abab57..b5c2bedf4 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.4'; + const CI_VERSION = '3.1.5-dev'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From ab0010f543d88fa19506907684a9d329d4dd94e3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 25 May 2017 12:14:41 +0300 Subject: [ci skip] Fix #5131 --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index b5c2bedf4..0fab092e5 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -434,7 +434,7 @@ if ( ! is_php('5.4')) * ReflectionMethod::isConstructor() is the ONLY reliable check, * knowing which method will be executed as a constructor. */ - elseif ( ! is_callable(array($class, $method)) && strcasecmp($class, $method) === 0) + elseif ( ! is_callable(array($class, $method))) { $reflection = new ReflectionMethod($class, $method); if ( ! $reflection->isPublic() OR $reflection->isConstructor()) -- cgit v1.2.3-24-g4f1b From 2459285b91d6fc4f5099f9f597529cce1059cb33 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Jun 2017 11:29:39 +0300 Subject: [ci skip] Prepare 3.1.5 release --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/CodeIgniter.php') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0fab092e5..823e034d7 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - const CI_VERSION = '3.1.5-dev'; + const CI_VERSION = '3.1.5'; /* * ------------------------------------------------------ -- cgit v1.2.3-24-g4f1b