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