summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite/sqlite_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-03 03:37:48 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-03 03:37:48 +0100
commitc28e7025f93114afa8c9ab7fb9d65b9c329e2ae6 (patch)
treed39092f36aff1c81db2a644be950437f135d1fd6 /system/database/drivers/sqlite/sqlite_driver.php
parentbfe6922c7a10701aee56ee9072243cf58d9e96a4 (diff)
parenta19beb0c580ac78c4b75548a046240a85f30cb29 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/sqlite/sqlite_driver.php')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php34
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;
}
// --------------------------------------------------------------------