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

    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($listas$tmpfile){
    @unlink($tmpfile);
    }
    returntrue;
    }

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

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