summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-06 03:29:36 +0200
committeradmin <devnull@localhost>2006-10-06 03:29:36 +0200
commita658e314697e0b9e529a73df25edf4fffaf2b519 (patch)
treead6d99a503db0d0a1ed53d0de6984b18e7e20a68 /system/database/DB_driver.php
parent7da9476fe67661398484ff57bdfad94ea483476d (diff)
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 403255799..f77b46609 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -51,6 +51,7 @@ class CI_DB_driver {
var $_trans_failure = FALSE; // Used with transactions to determine if a rollback should occur
var $cache_on = FALSE;
var $cachedir = '';
+ var $cache_autodel = TRUE;
var $CACHE; // The cache class object
@@ -287,7 +288,7 @@ class CI_DB_driver {
{
// If caching is enabled we'll auto-cleanup any
// existing files related to this particular URI
- if ($this->cache_on == TRUE AND $this->_cache_init())
+ if ($this->cache_on == TRUE AND $this->cache_autodel == TRUE AND $this->_cache_init())
{
$this->CACHE->delete();
}
@@ -331,6 +332,10 @@ class CI_DB_driver {
$CR->num_rows = $RES->num_rows();
$CR->result_object = $RES->result_object();
$CR->result_array = $RES->result_array();
+
+ // Reset these since cached objects can not utilize resource IDs.
+ $CR->conn_id = NULL;
+ $CR->result_id = NULL;
$this->CACHE->write($sql, $CR);
}
@@ -910,6 +915,19 @@ class CI_DB_driver {
{
return $this->cache_on = FALSE;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Set the cache "auto-delete" value
+ *
+ * @access public
+ * @return void
+ */
+ function cache_autodelete($val = TRUE)
+ {
+ $this->cache_autodel = ( ! is_bool($val)) ? TRUE : $val;
+ }
// --------------------------------------------------------------------