From e6419c4eeed88280a3e59851987e202f4c614dad Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 6 Oct 2006 01:50:43 +0000 Subject: --- system/database/DB_cache.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'system/database/DB_cache.php') diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 344736c24..913140f6c 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -159,12 +159,19 @@ class CI_DB_Cache { * @access public * @return bool */ - function delete() - { - $uri = ($this->obj->uri->segment(1) == FALSE) ? 'base' : $this->obj->uri->segment(2); - $uri .= ($this->obj->uri->segment(2) == FALSE) ? 'index' : $this->obj->uri->segment(2); + function delete($segment_one = '', $segment_two = '') + { + if ($segment_one == '') + { + $segment_one = ($this->obj->uri->segment(1) == FALSE) ? 'default' : $this->obj->uri->segment(2); + } + + if ($segment_two == '') + { + $segment_two = ($this->obj->uri->segment(2) == FALSE) ? 'index' : $this->obj->uri->segment(2); + } - $dir_path = $this->obj->db->cachedir.md5($uri).'/'; + $dir_path = $this->obj->db->cachedir.md5($segment_one.'_'.$segment_two).'/'; delete_files($dir_path, TRUE); } -- cgit v1.2.3-24-g4f1b