diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-01-30 21:52:22 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-01-30 21:52:22 +0100 |
commit | 72d61337496738d276d7671f0e07f201713aec6a (patch) | |
tree | cdc7c48e4450ec6e8c85efdffa06f1e466c15c13 | |
parent | afc7fd52389adf43756e1083fe854ce0da61710f (diff) |
Fixed bug #1813 - added check for $CI->db isset() and is_object() before returning false in Loader::database()
-rw-r--r-- | system/libraries/Loader.php | 8 | ||||
-rw-r--r-- | 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 <li>Added a check for NULL fields in the MySQL database backup utility.</li>
<li>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.</li>
<li>Deprecated from Active Record; <kbd>getwhere()</kbd> for <kbd>get_where()</kbd>; <kbd>groupby()</kbd> for <kbd>group_by()</kbd>; <kbd>havingor()</kbd> for <kbd>having_or()</kbd>; <kbd>orderby()</kbd> for <kbd>order_by</kbd>; <kbd>orwhere()</kbd> for <kbd>or_where()</kbd>; and <kbd>orlike()</kbd> for <kbd>or_like()</kbd>.</li>
- <li>Modified <kbd>csv_from_result()</kbd> to output CSV data more in the spirit of basic rules of RFC 4180.</li>
+ <li>Modified <kbd>csv_from_result()</kbd> to output CSV data more in the spirit of basic rules of RFC 4180.</li>
+ <li>Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.</li>
+ <li>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).</li>
</ul>
</li>
@@ -164,6 +167,7 @@ Change Log <h3>Bug fixes for Version 1.6.0</h3>
<ul>
+ <li>Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.</li>
<li>Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.</li>
<li>Fixed a bug (#1872) where word_limiter() was not retaining whitespace.</li>
<li>Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.</li>
|