diff options
author | Derek Jones <derek.jones@ellislab.com> | 2010-03-03 00:24:46 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2010-03-03 00:24:46 +0100 |
commit | e77922026939fed28a607338e24c1c37066a97b4 (patch) | |
tree | f0585758f86bcae945d0798c2af17d522c630928 /system/database/DB_driver.php | |
parent | d10e89666380d717e3e40dda046be78dbb7a38c4 (diff) |
whitespace and changes to load_class() to use core
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index d7f17ccb8..dfef42757 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -261,10 +261,10 @@ class CI_DB_driver { // Verify table prefix and replace if necessary if ( ($this->dbprefix != '' AND $this->swap_pre != '') AND ($this->dbprefix != $this->swap_pre) ) - { + { $sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql); } - + // Is query caching enabled? If the query is a "read type" // we will load the caching class and return the previously // cached query if it exists @@ -679,7 +679,7 @@ class CI_DB_driver { * @return mixed */ function escape($str) - { + { if (is_string($str)) { $str = "'".$this->escape_str($str)."'"; @@ -697,7 +697,7 @@ class CI_DB_driver { } // -------------------------------------------------------------------- - + /** * Escape LIKE String * @@ -714,7 +714,7 @@ class CI_DB_driver { } // -------------------------------------------------------------------- - + /** * Primary * @@ -1155,7 +1155,7 @@ class CI_DB_driver { */ function display_error($error = '', $swap = '', $native = FALSE) { - $LANG =& load_class('Language'); + $LANG =& load_class('Lang', 'core'); $LANG->load('db'); $heading = $LANG->line('db_error_heading'); @@ -1169,7 +1169,7 @@ class CI_DB_driver { $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; } - $error =& load_class('Exceptions'); + $error =& load_class('Exceptions', 'core'); echo $error->show_error($heading, $message, 'error_db'); exit; } @@ -1315,13 +1315,13 @@ class CI_DB_driver { { $i++; } - + // Verify table prefix and replace if necessary if ($this->swap_pre != '' && strncmp($parts[$i], $this->swap_pre, strlen($this->swap_pre)) === 0) { $parts[$i] = preg_replace("/^".$this->swap_pre."(\S+?)/", $this->dbprefix."\\1", $parts[$i]); } - + // We only add the table prefix if it does not already exist if (substr($parts[$i], 0, strlen($this->dbprefix)) != $this->dbprefix) { |