mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进File缓存的clear方法
This commit is contained in:
5
library/think/cache/driver/File.php
vendored
5
library/think/cache/driver/File.php
vendored
@@ -226,7 +226,10 @@ class File extends Driver
|
|||||||
$files = (array) glob($this->options['path'] . ($this->options['prefix'] ? $this->options['prefix'] . DS : '') . '*');
|
$files = (array) glob($this->options['path'] . ($this->options['prefix'] ? $this->options['prefix'] . DS : '') . '*');
|
||||||
foreach ($files as $path) {
|
foreach ($files as $path) {
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
array_map('unlink', glob($path . '/*.php'));
|
$matches = glob($path . '/*.php');
|
||||||
|
if (is_array($matches)) {
|
||||||
|
array_map('unlink', $matches);
|
||||||
|
}
|
||||||
rmdir($path);
|
rmdir($path);
|
||||||
} else {
|
} else {
|
||||||
unlink($path);
|
unlink($path);
|
||||||
|
|||||||
Reference in New Issue
Block a user