summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB.php7
-rw-r--r--system/database/DB_driver.php8
-rw-r--r--system/database/DB_utility.php21
3 files changed, 17 insertions, 19 deletions
diff --git a/system/database/DB.php b/system/database/DB.php
index f7476a68e..62237440f 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -24,8 +24,6 @@
*/
function DB($params = '', $return = FALSE, $active_record = FALSE)
{
- $obj =& get_instance();
-
// Do we even need to load the database class?
if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE)
{
@@ -92,8 +90,9 @@ function DB($params = '', $return = FALSE, $active_record = FALSE)
{
return $DB;
}
-
- $obj->db =& $DB;
+
+ $CI =& get_instance();
+ $CI->db =& $DB;
}
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index b89ebbf8d..c8a00b7b1 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -165,13 +165,13 @@ class CI_DB_driver {
* @return string
*/
function load_utilities()
- {
- $obj =& get_instance();
-
+ {
require_once(BASEPATH.'database/DB_utility'.EXT);
require_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_utility'.EXT);
$class = 'CI_DB_'.$this->dbdriver.'_utility';
- $obj->dbutil = new $class();
+
+ $CI =& get_instance();
+ $CI->dbutil = new $class();
}
// --------------------------------------------------------------------
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 433056ff0..64d67db41 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -36,8 +36,8 @@ class CI_DB_utility {
function CI_DB_utility()
{
// Assign the main database object to $this->db
- $obj =& get_instance();
- $this->db =& $obj->db;
+ $CI =& get_instance();
+ $this->CI =& $obj->db;
log_message('debug', "Database Utility Class Initialized");
}
@@ -286,8 +286,8 @@ class CI_DB_utility {
extract($params);
// Load the xml helper
- $obj =& get_instance();
- $obj->load->helper('xml');
+ $CI =& get_instance();
+ $CI->load->helper('xml');
// Generate the result
$xml = "<{$root}/>".$newline;
@@ -391,10 +391,7 @@ class CI_DB_utility {
}
// ------------------------------------------------------
-
- // Grab the super object
- $obj =& get_instance();
-
+
// Was a Gzip file requested?
if ($prefs['format'] == 'gzip')
{
@@ -427,9 +424,11 @@ class CI_DB_utility {
}
// Load the Zip class and output it
- $obj->load->library('zip');
- $obj->zip->add_data($prefs['filename'], $this->_backup($prefs));
- return $obj->zip->get_zip();
+
+ $CI =& get_instance();
+ $CI->load->library('zip');
+ $CI->zip->add_data($prefs['filename'], $this->_backup($prefs));
+ return $CI->zip->get_zip();
}
}