Copyright @ 2015-2020 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-1

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
dedecms在后台,点击更新系统缓存的时候,有些缓存文件夹没有清理,导致垃圾文件越来越多,可以以百千计算,现在增加清理以下缓存文件夹的功能:
data\cache
data\tplcache
data\sessions
打开文件:dede\sys_cache_up.php
找到CheckPurview('sys_ArcBatch');在其下一行添加以下代码:
//清理缓存增加版 function clean_cachefiles( $path ) { $list = array(); foreach( glob( $path . '/*') as $item ) { if( is_dir( $item ) ) { $list = array_merge( $list , clean_cachefiles( $item ) ); } else { $list[] = $item; } } foreach( $list as $tmpfile ) { @unlink( $tmpfile ); } return true; } |
//清理datacache clean_cachefiles( "../data/cache" ); //清理datatplcache clean_cachefiles( "../data/tplcache" ); //清理datasessions clean_cachefiles( "../data/sessions" ); |