Merge pull request #5 from shuipf/master

修复File缓存方式下,clear报错误
This commit is contained in:
ThinkPHP
2016-03-30 21:15:21 +08:00

View File

@@ -186,18 +186,11 @@ class File
*/
public function clear()
{
$path = $this->options['path'];
if ($dir = opendir($path)) {
while ($file = readdir($dir)) {
$check = is_dir($file);
if (!$check) {
$this->unlink($path . $file);
}
}
closedir($dir);
return true;
$fileLsit = (array)glob($this->options['path'].'*');
foreach ($fileLsit as $path) {
is_file($path) && unlink($path);
}
return true;
}
/**