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/Hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 2cb416c0c..59759e02e 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -81,7 +81,7 @@ class CI_Hooks { } // Grab the "hooks" definition file. - if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) + if (is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } -- cgit v1.2.3-24-g4f1b From 0687911229be13e100724dbf8b15b95146b591a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 29 Jan 2013 15:05:02 +0200 Subject: Replace is_file() with the faster file_exists() (where it makes sense) Also: - Implemented caching of configuration arrays for smileys, foreign characters and doctypes. - Implemented cascading-style loading of configuration files (except for library configs, DB and constants.php). --- system/core/Hooks.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 59759e02e..17f6a027e 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -81,11 +81,12 @@ class CI_Hooks { } // Grab the "hooks" definition file. - if (is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } - elseif (is_file(APPPATH.'config/hooks.php')) + + if (file_exists(APPPATH.'config/hooks.php')) { include(APPPATH.'config/hooks.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/Hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Hooks.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); } -- cgit v1.2.3-24-g4f1b