当前位置: 首页>>代码示例>>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;未经允许,请勿转载。