mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
cache clean works fine with file adapter. no need to hassle around with file handling
This commit is contained in:
@@ -266,28 +266,6 @@ class Debug_model extends CI_Model
|
||||
'key_prefix' => $cache_key_prefix
|
||||
]);
|
||||
|
||||
if ($cache_adapter === 'file') {
|
||||
$cache_path = $this->config->item('cache_path') ?: 'application/cache';
|
||||
$cache_path = realpath(APPPATH . '../') . '/' . $cache_path;
|
||||
|
||||
if (!is_dir($cache_path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($cache_path, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::CHILD_FIRST
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($file->isFile() && !in_array($file->getFilename(), ['index.html', '.htaccess'])) {
|
||||
@unlink($file->getRealPath());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (method_exists($this->cache, 'clean')) {
|
||||
return $this->cache->clean();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user