PHP实现如何清除TP的文件缓存 thinkphp


# PHP实现如何清除TP的文件缓存
public function cache_clear() {
    $this->deldir(TEMP_PATH);
}
function deldir($dir) {
    $dh = opendir($dir);
    while ($file = readdir($dh)) {
        if ($file != "." && $file != "..") {
            $fullpath = $dir . "/" . $file;
            if (!is_dir($fullpath)) {
                unlink($fullpath);
            } else {
                deldir($fullpath);
            }
        }
    }
}


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回