示例#1
0
 function _loadGatherCache($cacheName)
 {
     static $_cacheNames = null;
     $cacheName = strtolower($cacheName);
     if (!isset($_cacheNames[$cacheName])) {
         $filePath = R_P . "lib/gather/gathercache/" . $cacheName . ".cache.php";
         if (!is_file($filePath)) {
             return false;
         }
         # pack class start
         $className = 'GatherCache_' . $cacheName . '_Cache';
         $filePath = pwPack::classPath($filePath, $className);
         # pack class end
         require_once S::escapePath($filePath);
         #$className = 'GatherCache_' . $cacheName . '_Cache';
         if (!class_exists($className)) {
             return false;
         }
         $_cacheNames[$cacheName] =& new $className();
     }
     return $_cacheNames[$cacheName];
 }
示例#2
0
     S::gp(array('fid'));
     //* $memcache = new ClearMemcache();
     //* $memcache->refresh(array($fid));
     $_cacheService = Perf::gatherCache('pw_threads');
     $_cacheService->clearCacheForThreadListByForumIds($fid);
     adminmsg('operate_success');
 } elseif ($action == 'clearClassCompressFile') {
     $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
     // 清除类库压缩文件
     $_packService = pwPack::getPackService();
     $_packService->flushClassFiles();
     adminmsg('operate_success');
 } elseif ($action == 'clearCacheCompressFile') {
     $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
     // 清除data目录下的缓存文件的压缩包
     $_packService = pwPack::getPackService();
     $_packService->flushCacheFiles();
     adminmsg('operate_success');
 } elseif ($action == 'clearUniqueCache') {
     // 清除唯一主键的缓存
     $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
     $uniqueService = L::loadClass('unique', 'utility');
     $uniqueService->clear($GLOBALS['db_unique_strategy']);
     adminmsg('operate_success');
 } elseif ($action == 'clearMemcache') {
     $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
     S::gp(array('fid'));
     //* $memcache = new ClearMemcache();
     //* $memcache->clear(array($fid));
     $_cacheService = Perf::gatherCache('pw_threads');
     $_cacheService->clearCacheForThreadListByForumIds($fid);
示例#3
0
文件: common.php 项目: jechiy/PHPWind
 function files()
 {
     if (!in_array(SCR, array('index', 'read', 'thread'))) {
         return false;
     }
     $_packService = pwPack::getPackService();
     if ($GLOBALS['db_cachefile_compress']) {
         $_packService->packCacheFiles();
     }
     return true;
 }
 function deleteData($filePath)
 {
     if ($GLOBALS['db_filecache_to_memcache'] && Perf::checkMemcache()) {
         $this->_clearDataFromMemcache($filePath);
     }
     if ($GLOBALS['db_cachefile_compress']) {
         $_packService = pwPack::getPackService();
         $_packService->flushCacheFiles();
     }
     return P_unlink($filePath);
 }
示例#5
0
function pwOutPut()
{
    global $db_htmifopen, $db_redundancy, $SCR, $groupid;
    $masterDb = $GLOBALS['db']->getMastdb();
    if ($masterDb->arr_query) {
        writeover(D_P . "data/sqllist.txt", $masterDb->arr_query, 'wb');
    }
    Update_ol();
    $output = parseHtmlUrlRewrite(ob_get_contents(), $db_htmifopen);
    if ($db_redundancy && $SCR != 'post') {
        $output = str_replace(array("\r", '<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\n", '<!---->', '<!-- -->', "<!--\n-->", "\t\t", '    ', "\n\t", "\n\n"), array('', '', '', '', '', '', '', '', '', '', "\n", "\n"), $output);
    } else {
        $output = str_replace(array('<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $output);
    }
    if (!defined('AJAX')) {
        require_once R_P . 'aCloud/aCloud.php';
        $output .= ACloud_App_Guiding::getApp();
    }
    if ($SCR != 'post' && !defined('AJAX')) {
        $ceversion = defined('CE') ? 1 : 0;
        $output .= "<script type=\"text/javascript\">(function(d,t){\r\nvar url=\"http://init.phpwind.net/init.php?sitehash={$GLOBALS[db_sitehash]}&v={$GLOBALS[wind_version]}&c={$ceversion}\";\r\nvar g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>";
    }
    if ($groupid == 'guest' && !defined('MSG') && GetGcache()) {
        require_once R_P . 'require/guestfunc.php';
        creatguestcache($output);
    }
    if (defined('SHOWLOG')) {
        Error::writeLog();
    }
    if (defined('PW_PACK_FILES')) {
        pwPack::files();
    }
    echo ObContents($output);
    unset($output);
    N_flush();
    exit;
}