summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite/sqlite_driver.php
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-03-09 10:56:21 +0100
committerTaufan Aditya <toopay@taufanaditya.com>2012-03-09 10:56:21 +0100
commitb3723ff33ebfd4f4e7822516ecb061613f1bc3d5 (patch)
treee55d564db25daa3216c3f3e7ae95e315387d6038 /system/database/drivers/sqlite/sqlite_driver.php
parent4054c56b882ad40495f2d227990d73437af51038 (diff)
parent0f2cb79b976086cb73140c25f4c568e865177426 (diff)
Merged with latest commit
Diffstat (limited to 'system/database/drivers/sqlite/sqlite_driver.php')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php54
1 files changed, 15 insertions, 39 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index a6257cb1f..3eaec949c 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -18,7 +18,7 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/)
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
* @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
@@ -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();
}
// --------------------------------------------------------------------
@@ -428,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;
}
// --------------------------------------------------------------------
@@ -667,4 +643,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 */