www.gusucode.com > mcms手机网站系统 v3.1源码程序 > mcms_v3.1.0/upload/app/admin/cache.clear.php

    <?php
/*
 * MCMS Copyright (c) 2012-2013 ZhangYiYeTai Inc.
 * 
 *  http://www.mcms.cc
 * 
 * The program developed by loyjers core architecture, individual all rights reserved, 
 * if you have any questions please contact loyjers@126.com
 */

require_once(dirname(__FILE__) . "/../../init.php"); //公用引导启动文件
check_login();
check_level('C09',AJAX);
$time_start = H :: getmicrotime(); //开始时间

// 动作处理
call_mfunc();

// 模板处理
require_once(assign_tpl(basename(__FILE__), 'admin'));

// ******************************************************* 函数方法 *******************************************************
function m__list(){
}

function m__cache_clear(){
    global $T,$C;
    $_GET['type']=isset($_GET['type'])?$_GET['type']:'';
    if($_GET['type']=='categories') $C->update_cache();
    if($_GET['type']=='trees') $T->update_cache();
    if($_GET['type']=='model') $C->update_cache_model();
    if($_GET['type']=='rewrites') $C->update_cache_rewrite();
    if($_GET['type']=='count') {
        H::del_dir(ROOT_PATH.'/config/cache/count');
    }
    if($_GET['type']=='templates') {
        H::del_dir(ROOT_PATH.'/config/cache/templates');
    }
    if($_GET['type']=='vars') {
        H::del_dir(ROOT_PATH.'/config/cache/vars');
    }
    if($_GET['type']=='all') {
        H::del_dir(ROOT_PATH.'/config/cache/templates');
        H::del_dir(ROOT_PATH.'/config/cache/count');
        H::del_dir(ROOT_PATH.'/config/cache/category');
        H::del_dir(ROOT_PATH.'/config/cache/code');
        H::del_dir(ROOT_PATH.'/config/cache/rewrites');
        H::del_dir(ROOT_PATH.'/config/cache/weixin');
        H::del_dir(ROOT_PATH.'/config/cache/vars');
        $T->update_cache();
    }
    die('{"code":"0","msg":"清理成功"}');
}

?>