云企logo

dedecms“更新系统缓存”清理沉积缓存的功能

更新日期:2022-06-19  

dedecms“更新系统缓存”清理沉积缓存的功能,主要增加清理以下缓存文件夹的功能:datacache;data plcache;datasessions,

操作方法:

打开后台文件: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;
}

找到if($uparc==1),在其上一行添加以下代码:

//清理datacache
clean_cachefiles( "../data/cache" );
//清理datatplcache
clean_cachefiles( "../data/tplcache" );
//清理datasessions
clean_cachefiles( "../data/sessions" );

 

上一篇:DedeCMS文章内容图片自动添加alt标签

下一篇:first-child 选择器 定义首个子元素样式
首页