diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php
index 86493e7..aee5ce6 100644
--- a/system/database/DB_cache.php
+++ b/system/database/DB_cache.php
@@ -171,7 +171,7 @@
$segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
}
- $dir_path = $this->CI->db->cachedir.md5($segment_one.'+'.$segment_two).'/';
+ $dir_path = $this->CI->db->cachedir.$segment_one.'+'.$segment_two.'/';
delete_files($dir_path, TRUE);
}
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 848d4f1..a24bd20 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -236,6 +236,7 @@
{
if (FALSE !== ($cache = $this->CACHE->read($sql)))
{
+ $this->load_rdriver();
return $cache;
}
}
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index c0f5256..635ef1b 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -110,7 +110,7 @@
* @param bool whether to delete any directories found in the path
* @return bool
*/
-function delete_files($path, $del_dir = FALSE)
+function delete_files($path, $del_dir = FALSE, $level = 0)
{
// Trim the trailing slash
$path = preg_replace("|^(.+?)/*$|", "\\1", $path);
@@ -124,7 +124,8 @@
{
if (is_dir($path.'/'.$filename))
{
- delete_files($path.'/'.$filename, $del_dir);
+ $level++;
+ delete_files($path.'/'.$filename, $del_dir, $level);
}
else
{
@@ -134,7 +135,7 @@
}
@closedir($current_dir);
- if ($del_dir == TRUE)
+ if ($del_dir == TRUE AND $level > 0)
{
@rmdir($path);
}