0
点赞
收藏
分享

微信扫一扫

tp6清除缓存


public function del_cache(){
//删除缓存目录下的文件runtime目录下的文件
$path=root_path().'runtime';//runtime
delFileByDir($path);
//return alert('清空缓存成功','index/index',6);
return alert('清空缓存成功','/qingadmin/index/welcome',6);
}
//删除目录及文件,传入目录
function delFileByDir($dir) {
$dh = opendir($dir);//读取文件目录
while ($file = readdir($dh)) {
if ($file != "." && $file != "..") {//去掉.和..这两步

$fullpath = $dir . "/" . $file;//看目录下是不是文件
if (is_dir($fullpath)) {//如果是目录的话
delFileByDir($fullpath);//递归(从内往外删除)
} else {
unlink($fullpath);
}
}
}
closedir($dh);
}



举报

相关推荐

tp6 RabbitMQ

安装tp6

tp6调试(trace)

tp6 开启session

TP6 简单登录

TP6学习笔记

0 条评论