diff options
author | Mike Funk <mfunk@xulonpress.com> | 2012-03-07 19:33:27 +0100 |
---|---|---|
committer | Mike Funk <mfunk@xulonpress.com> | 2012-03-07 19:33:27 +0100 |
commit | 9fcb2ad0e435fdfeda5b147b3fee112b4cb89861 (patch) | |
tree | bbaa310e66f1b6463a498737658674cf1c0322ae /system/database/drivers/sqlite/sqlite_driver.php | |
parent | aa20f5b70f6da196d1a66d5dc17b05a037708e1a (diff) | |
parent | 1d571971be8be78a92d31aad27dda4009770043f (diff) |
merged latest develop branch, fixed changelog conflict.
Diffstat (limited to 'system/database/drivers/sqlite/sqlite_driver.php')
-rw-r--r-- | system/database/drivers/sqlite/sqlite_driver.php | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 28c3caecd..91598ab0f 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -141,30 +141,15 @@ class CI_DB_sqlite_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Set client character set + * Database version number * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public * @return string */ - function _version() + public function version() { - return sqlite_libversion(); + return isset($this->data_cache['version']) + ? $this->data_cache['version'] + : $this->data_cache['version'] = sqlite_libversion(); } // -------------------------------------------------------------------- @@ -358,8 +343,7 @@ class CI_DB_sqlite_driver extends CI_DB { return 0; } - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - + $query = $this->query($this->_count_string.$this->protect_identifiers('numrows').' FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE)); if ($query->num_rows() == 0) { return 0; @@ -428,27 +412,18 @@ class CI_DB_sqlite_driver extends CI_DB { // -------------------------------------------------------------------- /** - * The error message string + * Error * - * @access private - * @return string - */ - function _error_message() - { - return sqlite_error_string(sqlite_last_error($this->conn_id)); - } - - // -------------------------------------------------------------------- - - /** - * The error message number + * Returns an array containing code and message of the last + * database error that has occured. * - * @access private - * @return integer + * @return array */ - function _error_number() + public function error() { - return sqlite_last_error($this->conn_id); + $error = array('code' => sqlite_last_error($this->conn_id)); + $error['message'] = sqlite_error_string($error['code']); + return $error; } // -------------------------------------------------------------------- @@ -667,4 +642,4 @@ class CI_DB_sqlite_driver extends CI_DB { /* End of file sqlite_driver.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */
\ No newline at end of file +/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ |