diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:49:43 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:49:43 +0100 |
commit | 531c045a5da3f42650bbad21b32a838d90374dba (patch) | |
tree | 8add11f8a28920820390a04d7de79bb29fc3be41 /system/database/DB_driver.php | |
parent | af3ae4f2179ab3fea8d4a484c6e02483fba1071c (diff) | |
parent | e3a68042c086acfc98ae273adbd8527af0c6ab8b (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-sqlite3
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 345808ea0..73ec4e3ed 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); } // -------------------------------------------------------------------- |