diff options
Diffstat (limited to 'system/database/DB_cache.php')
-rw-r--r-- | system/database/DB_cache.php | 17 |
1 files changed, 12 insertions, 5 deletions
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); } |