diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:44:26 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:44:26 +0100 |
commit | f4ec1f21d5d53ce7c2a1076ca8fd3ab2e6223a6e (patch) | |
tree | 6488c0e16d040dc5b112ea990bd6051ff32e003c /system/database/DB_driver.php | |
parent | 575bbfe97e4f0e3ad88558454fb2c87d372a7651 (diff) | |
parent | e3a68042c086acfc98ae273adbd8527af0c6ab8b (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 271a70ec4..5f435e363 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -185,20 +185,19 @@ class CI_DB_driver { /** * Set client character set * - * @access public * @param string * @param string - * @return resource + * @return bool */ - function db_set_charset($charset, $collation) + public function db_set_charset($charset, $collation = '') { - if ( ! $this->_db_set_charset($this->char_set, $this->dbcollat)) + if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset, $collation)) { - log_message('error', 'Unable to set database connection charset: '.$this->char_set); + log_message('error', 'Unable to set database connection charset: '.$charset); if ($this->db_debug) { - $this->display_error('db_unable_to_set_charset', $this->char_set); + $this->display_error('db_unable_to_set_charset', $charset); } return FALSE; @@ -645,17 +644,12 @@ class CI_DB_driver { /** * Determines if a query is a "write" type. * - * @access public * @param string An SQL query string - * @return boolean + * @return bool */ - function is_write_type($sql) + public function is_write_type($sql) { - if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) - { - return FALSE; - } - return TRUE; + return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE)\s+/i', $sql); } // -------------------------------------------------------------------- @@ -1424,6 +1418,22 @@ class CI_DB_driver { return $item.$alias; } + + // -------------------------------------------------------------------- + + /** + * Dummy method that allows Active Record class to be disabled + * + * This function is used extensively by every db driver. + * + * @access private + * @return void + */ + protected function _reset_select() + { + + } + } /* End of file DB_driver.php */ |