From e5ff3dcd795f8a9a27e8c2026a93571e65a5961d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 17 Oct 2008 04:57:16 +0000 Subject: Fixed a bug (4718) in which the path to the files was being set in correctly. --- system/database/DB_cache.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'system') 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); -- cgit v1.2.3-24-g4f1b