<?php !function_exists('adminmsg') && exit('Forbidden'); empty($adminitem) && ($adminitem = 'updatecache'); $jobUrl = "{$admin_file}?adminjob=aboutcache"; $basename = "{$admin_file}?adminjob=aboutcache&adminitem={$adminitem}"; if ($adminitem == 'updatecache') { if (empty($action)) { $memcache = new ClearMemcache(); $isMemcachOpen = $memcache->_isMemecacheOpen(); if ($isMemcachOpen) { $forumSelect = getForumSelectHtml(); } $isUniqueStrategyOpen = $isMemcachOpen; include PrintEot('updatecache'); exit; } elseif ($action == 'cache') { updatecache(); adminmsg('operate_success'); } elseif ($_POST['action'] == 'topped') { require_once R_P . 'require/updateforum.php'; updatetop(); adminmsg('operate_success'); } elseif ($_POST['action'] == 'bbsinfo') { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $count = $userService->count(); $lastestUser = $userService->getLatestNewUser(); //* $db->update("UPDATE pw_bbsinfo SET newmember=".S::sqlEscape($lastestUser['username']).", totalmember=".S::sqlEscape($count)."WHERE id='1'"); pwQuery::update('pw_bbsinfo', 'id=:id', array(1), array('newmember' => $lastestUser['username'], 'totalmember' => $count)); adminmsg('operate_success');
} } elseif ($action == 'refreshMemcache') { $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify); InitGP(array('fid')); $memcache = new ClearMemcache(); $memcache->refresh(array($fid)); adminmsg('operate_success'); } elseif ($action == 'clearMemcache') { $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify); InitGP(array('fid')); $memcache = new ClearMemcache(); $memcache->clear(array($fid)); adminmsg('operate_success'); } elseif ($action == 'flushMemcache') { $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify); $memcache = new ClearMemcache(); $memcache->flush(); adminmsg('operate_success'); } class ClearMemcache { /* * 刷新缓存 */ function refresh($forumIds) { if (!is_array($forumIds)) { return false; } $threadList = $this->_getThreadList(); foreach ($forumIds as $forumId) {