diff options
-rw-r--r-- | system/database/DB_cache.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index ecb2b13a1..9bb1b165b 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -93,13 +93,14 @@ class CI_DB_Cache { {
return $this->db->cache_off();
}
-
- $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+';
- $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
+
+ $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1);
- $filepath = $uri.'/'.md5($sql);
+ $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
+
+ $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql);
- if (FALSE === ($cachedata = read_file($this->db->cachedir.$filepath)))
+ if (FALSE === ($cachedata = read_file($filepath)))
{
return FALSE;
}
@@ -122,10 +123,11 @@ class CI_DB_Cache { return $this->db->cache_off();
}
- $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+';
- $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
+ $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1);
- $dir_path = $this->db->cachedir.$uri.'/';
+ $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
+
+ $dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/';
$filename = md5($sql);
|