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 +++--- system/core/Common.php | 4 ++-- system/core/Hooks.php | 2 +- system/core/Loader.php | 10 +++++----- system/core/Output.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'system/core') 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')) { diff --git a/system/core/Common.php b/system/core/Common.php index f8c1290f5..ee9bb2e87 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -149,7 +149,7 @@ if ( ! function_exists('load_class')) { $name = $prefix.$class; - if (class_exists($name) === FALSE) + if (class_exists($name, FALSE) === FALSE) { require_once($path.$directory.'/'.$class.'.php'); } @@ -163,7 +163,7 @@ if ( ! function_exists('load_class')) { $name = config_item('subclass_prefix').$class; - if (class_exists($name) === FALSE) + if (class_exists($name, FALSE) === FALSE) { require_once(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'); } diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 17f6a027e..b3b111991 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -195,7 +195,7 @@ class CI_Hooks { // Call the requested class and/or function if ($class !== FALSE) { - if ( ! class_exists($class)) + if ( ! class_exists($class, FALSE)) { require($filepath); } diff --git a/system/core/Loader.php b/system/core/Loader.php index 9306a09ef..6e5b58ba7 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -270,7 +270,7 @@ class CI_Loader { continue; } - if ($db_conn !== FALSE && ! class_exists('CI_DB')) + if ($db_conn !== FALSE && ! class_exists('CI_DB', FALSE)) { if ($db_conn === TRUE) { @@ -280,7 +280,7 @@ class CI_Loader { $CI->load->database($db_conn, FALSE, TRUE); } - if ( ! class_exists('CI_Model')) + if ( ! class_exists('CI_Model', FALSE)) { load_class('Model', 'core'); } @@ -1091,11 +1091,11 @@ class CI_Loader { if ($prefix === '') { - if (class_exists('CI_'.$class)) + if (class_exists('CI_'.$class, FALSE)) { $name = 'CI_'.$class; } - elseif (class_exists(config_item('subclass_prefix').$class)) + elseif (class_exists(config_item('subclass_prefix').$class, FALSE)) { $name = config_item('subclass_prefix').$class; } @@ -1110,7 +1110,7 @@ class CI_Loader { } // Is the class name valid? - if ( ! class_exists($name)) + if ( ! class_exists($name, FALSE)) { log_message('error', 'Non-existent class: '.$name); show_error('Non-existent class: '.$name); diff --git a/system/core/Output.php b/system/core/Output.php index a20841463..25ecd496c 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -395,7 +395,7 @@ class CI_Output { global $BM, $CFG; // Grab the super object if we can. - if (class_exists('CI_Controller')) + if (class_exists('CI_Controller', FALSE)) { $CI =& get_instance(); } -- cgit v1.2.3-24-g4f1b