當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Perf::checkMemcache方法代碼示例

本文整理匯總了PHP中Perf::checkMemcache方法的典型用法代碼示例。如果您正苦於以下問題:PHP Perf::checkMemcache方法的具體用法?PHP Perf::checkMemcache怎麽用?PHP Perf::checkMemcache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Perf的用法示例。


在下文中一共展示了Perf::checkMemcache方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 function delete($tableName, $fields, $expand = array())
 {
     $this->_service->logForums('delete', $fields);
     if (Perf::checkMemcache()) {
         $this->_service->clearForumsCache($tableName, $fields);
     }
 }
開發者ID:jechiy,項目名稱:PHPWind,代碼行數:7,代碼來源:pw_forums.query.php

示例2: unset

unset($forums, $forum, $db_showcms);
//info deploy
if (isset($deployfids['info'])) {
    $cate_img = 'open';
    $cate_info = 'none';
} else {
    $cate_img = 'fold';
    $cate_info = '';
}
// update birth day
if ($db_indexshowbirth) {
    $brithcache = '';
    require_once R_P . 'require/birth.php';
}
// get bbsinfo
if (Perf::checkMemcache()) {
    $_cacheService = Perf::getCacheService();
    $_bbsInfoResult = $_cacheService->get('bbsinfo_id_1');
    if (!$_bbsInfoResult) {
        $_bbsInfoService = L::loadClass('BbsInfoService', 'forum');
        $_bbsInfoResult = $_bbsInfoService->getBbsInfoById(1);
    }
    extract($_bbsInfoResult);
} else {
    extract($db->get_one("SELECT * FROM pw_bbsinfo WHERE id=1"));
}
$newmember = '<a href="u.php?username=' . rawurlencode($newmember) . '" target="_blank" class=" _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&username=' . rawurlencode($newmember) . '" data-card-key=' . $newmember . '>' . $newmember . '</a>';
$article += $o_post;
$topics += $o_post;
$tposts += $o_tpost;
// online users
開發者ID:jechiy,項目名稱:PHPWind,代碼行數:31,代碼來源:index.php

示例3: deleteData

 function deleteData($filePath)
 {
     if ($GLOBALS['db_filecache_to_memcache'] && Perf::checkMemcache()) {
         $this->_clearDataFromMemcache($filePath);
     }
     return $this->_db->query("REPLACE INTO " . $this->_getTableName() . "(ckey,cvalue,typeid,expire) VALUES (" . S::sqlEscape($this->_getFileKey($filePath)) . "," . S::sqlEscape('') . "," . S::sqlEscape('') . ",0)");
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:7,代碼來源:cachedistribute.class.php

示例4: PW_UserCache

 function PW_UserCache()
 {
     $this->_allowModes = array('article', 'cardtopic', 'reply', 'carddiary', 'cardphoto', 'friend', 'weibo', 'colony', 'messageboard', 'recommendUsers', 'friendsBirthday', 'tags');
     $this->_cache = Perf::checkMemcache();
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:5,代碼來源:usercache.class.php

示例5: changeForumDataWithForumId

 /**
  * 當發帖和發回複時,從memcache讀取緩存數據然後更新它,而不是直接刪除緩存
  *
  * @param array $information
  * @return boolean
  */
 function changeForumDataWithForumId($information = null)
 {
     if (!Perf::checkMemcache()) {
         return true;
     }
     if (!S::isArray($information) || !($information = current($information)) || !isset($information['fid'])) {
         return false;
     }
     $fid = intval($information['fid']);
     $_cacheService = Perf::getCacheService();
     $_cacheInfo = $_cacheService->get(array('all_forums_info', 'forumdata_announce_' . $fid));
     $_unique = $GLOBALS['db_memcache']['hash'];
     // 更新index頁麵裏版塊緩存
     if (isset($_cacheInfo[$_unique . 'all_forums_info'])) {
         $allForums = $_cacheInfo[$_unique . 'all_forums_info'];
         foreach ($information as $key => $value) {
             if (in_array($key, array('article', 'topic', 'tpost', 'subtopic'))) {
                 $allForums[$fid][$key] = $allForums[$fid][$key] + $value;
             } else {
                 $allForums[$fid][$key] = $value;
             }
         }
         $_cacheService->set('all_forums_info', $allForums, 300);
     }
     // 更新thread頁麵裏版塊和通告緩存
     if (isset($_cacheInfo[$_unique . 'forumdata_announce_' . $fid])) {
         $forums = $_cacheInfo[$_unique . 'forumdata_announce_' . $fid];
         foreach ($information as $key => $value) {
             if (in_array($key, array('article', 'topic', 'tpost', 'subtopic'))) {
                 $forums[$key] = $forums[$key] + $value;
             } else {
                 $forums[$key] = $value;
             }
         }
         $_cacheService->set('forumdata_announce_' . $fid, $forums, 300);
     }
     return true;
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:44,代碼來源:general.service.php


注:本文中的Perf::checkMemcache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。