From 3c04624c56a5a33c274a8b202392d4b10a1fec56 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 27 Nov 2017 15:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BFile=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=9A=84clear=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/File.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/cache/driver/File.php b/library/think/cache/driver/File.php index 95021e05..52243a47 100644 --- a/library/think/cache/driver/File.php +++ b/library/think/cache/driver/File.php @@ -226,7 +226,10 @@ class File extends Driver $files = (array) glob($this->options['path'] . ($this->options['prefix'] ? $this->options['prefix'] . DS : '') . '*'); foreach ($files as $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); } else { unlink($path);