diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-05 13:23:57 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-05 13:23:57 +0100 |
commit | 74496c268ae7199082cad86e0fea65687d78a2c9 (patch) | |
tree | 7a02e9961dda1e6949c4cbd986c894ffb9ed15a3 /system/database/drivers/sqlite/sqlite_driver.php | |
parent | bb5dae46256cdcb0bcd204b6fa2fc628da6afb88 (diff) | |
parent | cc5af53346397846f2035dc2bf6a2c2f9b0cd4ab (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/sqlite/sqlite_driver.php')
-rw-r--r-- | system/database/drivers/sqlite/sqlite_driver.php | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 718501b20..3eaec949c 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -141,14 +141,15 @@ class CI_DB_sqlite_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Version number query string + * Database version number * - * @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(); } // -------------------------------------------------------------------- @@ -412,27 +413,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; } // -------------------------------------------------------------------- |