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/database/DB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB.php') diff --git a/system/database/DB.php b/system/database/DB.php index f94685c51..d9104747f 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -43,7 +43,7 @@ function &DB($params = '', $query_builder_override = NULL) if (is_string($params) && strpos($params, '://') === FALSE) { // Is the config file in the environment folder? - if (( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php')) + if ( ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php') && ! file_exists($file_path = APPPATH.'config/database.php')) { show_error('The configuration file database.php does not exist.'); -- 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/database/DB.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/DB.php') diff --git a/system/database/DB.php b/system/database/DB.php index d9104747f..83d973304 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -149,7 +149,7 @@ function &DB($params = '', $query_builder_override = NULL) if ( ! isset($query_builder) OR $query_builder === TRUE) { require_once(BASEPATH.'database/DB_query_builder.php'); - if ( ! class_exists('CI_DB')) + if ( ! class_exists('CI_DB', FALSE)) { /** * CI_DB @@ -162,7 +162,7 @@ function &DB($params = '', $query_builder_override = NULL) class CI_DB extends CI_DB_query_builder { } } } - elseif ( ! class_exists('CI_DB')) + elseif ( ! class_exists('CI_DB', FALSE)) { /** * @ignore -- cgit v1.2.3-24-g4f1b