From 72d61337496738d276d7671f0e07f201713aec6a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 30 Jan 2008 20:52:22 +0000 Subject: Fixed bug #1813 - added check for $CI->db isset() and is_object() before returning false in Loader::database() --- system/libraries/Loader.php | 8 ++++---- user_guide/changelog.html | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index a59d6e38e..576cb11f3 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -193,8 +193,11 @@ class CI_Loader { */ function database($params = '', $return = FALSE, $active_record = FALSE) { + // Grab the super object + $CI =& get_instance(); + // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) + if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE AND isset($CI->db) AND is_object($CI->db)) { return FALSE; } @@ -205,9 +208,6 @@ class CI_Loader { { return DB($params, $active_record); } - - // Grab the super object - $CI =& get_instance(); // Initialize the db variable. Needed to prevent // reference errors with some configurations diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 908037a67..670cbdab8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -93,7 +93,10 @@ Change Log
  • Added a check for NULL fields in the MySQL database backup utility.
  • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • -
  • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
  • +
  • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
  • +
  • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
  • +
  • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more + in harmony with the global nature of the behavior (#1834).
  • @@ -164,6 +167,7 @@ Change Log

    Bug fixes for Version 1.6.0