示例#1
0
    foreach ($ptags as $k => $v) {
        $ocache = read_cache('ptag', $k, '', $nsid);
        cache2file($ocache, cache_name('ptag', $k), 'ptag', 0);
    }
    foreach ($rtags as $k => $v) {
        $ocache = read_cache('rtag', $k, '', $nsid);
        cache2file($ocache, cache_name('rtag', $k), 'rtag', 0);
    }
    clear_dir(M_ROOT . $subsite['dirname'], true);
    //清除子站目录
    clear_dir(M_ROOT . "dynamic/cache/{$nsid}/", true);
    //清除子站缓存
    m_unlink($homedefault);
    //清除可能残留的静态首页
    $db->query("DELETE FROM {$tblprefix}subsites WHERE sid='{$nsid}'", 'SILENT');
    rebuild_cache(-1);
    adminlog(lang('subsittranstmsite'));
    amessage('subtramsifin', '?entry=subsites&action=subsitesedit');
} elseif ($action == 'subsitedel' && $nsid) {
    if (empty($confirm)) {
        $message = lang('delsubsite') . '<br><br>' . lang('del_alert') . "<br><br>";
        $message .= lang('confirmclick') . "[<a href=?entry=subsites&action=subsitedel&nsid=" . $nsid . "&confirm=1>" . lang('delete') . "</a>]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        $message .= lang('giveupclick') . "[<a href=?entry=subsites&action=subsitesedit>" . lang('goback') . "</a>]";
        amessage($message);
    }
    if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}archives WHERE sid='{$nsid}'")) {
        amessage('subwitarccandel', '?entry=subsites&action=subsitesedit');
    }
    if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}catalogs WHERE sid='{$nsid}'")) {
        amessage('subwitcatcandel', '?entry=subsites&action=subsitesedit');
    }
示例#2
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
aheader();
backallow('other') || amessage('no_apermission');
if (!submitcheck('brebuilds')) {
    tabheader($sid ? lang('refsubsyca') : lang('refmssyscac'), $actionid . 'rebuilds', "?entry=rebuilds{$param_suffix}", 2);
    trbasic(lang('bassyscac'), '', "<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[based]\" value=\"1\" checked disabled>", '');
    trbasic(lang('catcnocac'), '', "<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[cnode]\" value=\"1\">", '');
    !$sid && trbasic(lang('allsitecac'), '', "<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[allsite]\" value=\"1\">", '');
    tabfooter('brebuilds');
    a_guide('rebuildcache');
} else {
    $exceptstr = '';
    if (empty($arcdeal['cnode'])) {
        $exceptstr .= ($exceptstr ? ',' : '') . 'cnodes';
    }
    if (!empty($arcdeal['allsite'])) {
        clear_dir(M_ROOT . './dynamic/cache', false, $exceptstr);
    }
    rebuild_cache(empty($arcdeal['allsite']) ? $sid : '-1', $exceptstr);
    amessage(($sid ? 'subsite' : 'msite') . 'syscacreffin', M_REFERER);
}
示例#3
0
function &get_cached_table($table, $anew = false)
{
    $cache =& singleton("cache");
    if ($anew || !$cache[$table]) {
        rebuild_cache($table);
    }
    return $cache[$table];
}
示例#4
0
function cacheinit()
{
    global $langs;
    include_once M_ROOT . './include/ios.fun.php';
    include_once M_ROOT . './include/cache.fun.php';
    showjsmessage(ilang('init_cache'));
    $langs = reload_cache('langs');
    rebuild_cache(-1);
}