当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheManager::setValueToCache方法代码示例

本文整理汇总了PHP中CacheManager::setValueToCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::setValueToCache方法的具体用法?PHP CacheManager::setValueToCache怎么用?PHP CacheManager::setValueToCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CacheManager的用法示例。


在下文中一共展示了CacheManager::setValueToCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getReviewsByProgram

 public function getReviewsByProgram($programid, $limit = 3, $offset = 0)
 {
     $key = 'PROGRAM_REVIEW_LIST_PROD_ID' . $programid . '_LIMIT_' . $limit . '_OFFSET_' . $offset;
     $lists = CacheManager::getValueFromCache($key);
     if ($lists) {
         return $lists;
     }
     $lists = Yii::app()->db->createCommand()->select('id as review_id, comment_title as title, comments ,douban_comment_id as douban_review_id,create_date as create_date ')->from($this->tableName())->where('status=:status and content_id=:prod_id and comment_type=1', array(':status' => Constants::OBJECT_APPROVAL, ':prod_id' => $programid))->order('create_date DESC')->limit($limit)->offset($offset)->queryAll();
     if (count($lists) > 0) {
         $prodExpired = CacheManager::getExpireByCache(CacheManager::CACHE_PARAM_EXPIRED_POPULAR_PROGRAM);
         CacheManager::setValueToCache($key, $lists, $prodExpired);
     }
     return $lists;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:14,代码来源:Comment.php

示例2: listSohuProduce

 public static function listSohuProduce($top_id, $limit, $offset)
 {
     $device = IjoyPlusServiceUtils::getDevice();
     $where = '';
     if ($device === false) {
         $key = SearchManager::CACHE_LIST_ITEMS_BY_TYPE_LIMIT_OFFSET . '_SohuProduce_' . $top_id . '_LIMIT_' . $limit . '_OFFSET_' . $offset;
     } else {
         $where = ' AND (can_search_device like \'%' . $device . '%\' or can_search_device is null or can_search_device =\'\' ) ';
         $key = SearchManager::CACHE_LIST_ITEMS_BY_TYPE_LIMIT_OFFSET . '_SohuProduce_' . $top_id . '_LIMIT_' . $limit . '_OFFSET_' . $offset . '_DEVICE_' . $device;
     }
     if (IjoyPlusServiceUtils::isExcludeCopyMovie()) {
         $where = $where . " and vod.d_area not like '%美国%' ";
     }
     $items = CacheManager::getValueFromCache($key);
     if ($items) {
         return $items;
     }
     $items = Yii::app()->db->createCommand()->select('vod.d_id as prod_id,vod.d_name as prod_name,vod.d_playfrom as sources,vod.d_level as definition, vod.d_type as prod_type,  substring_index( vod.d_pic, \'{Array}\', 1 )  as prod_pic_url, substring_index( vod.d_pic_ipad, \'{Array}\', 1 )  as big_prod_pic_url, vod.d_content as prod_summary,vod.d_starring as star,vod.d_directed as director ,vod.d_score as score,vod.favority_user_count as favority_num ,vod.good_number as support_num ,vod.d_year as publish_date,vod.d_area as area, vod.d_remarks as max_episode, vod.d_state as cur_episode , vod.duraning as duration ')->from('mac_vod_topic_items as items')->join("mac_vod as vod", "items.vod_id=vod.d_id")->where('items.flag=:t_flag and items.topic_id=:topic_id and vod.d_hide=0 ' . $where, array(':t_flag' => 1, ':topic_id' => $top_id))->order('items.disp_order desc, vod.d_level desc ,vod.d_good desc,vod.d_time DESC ')->limit($limit)->offset($offset)->queryAll();
     if (isset($items) && !is_null($items)) {
         $prodExpired = CacheManager::getExpireByCache(CacheManager::CACHE_PARAM_EXPIRED_POPULAR_PROGRAM);
         CacheManager::setValueToCache($key, $items, $prodExpired);
     }
     return $items;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:24,代码来源:SearchManager.php

示例3: synUserCache

 public static function synUserCache($user)
 {
     $key = CacheManager::CACHE_PROD_BY_PROD_ID . '_' . $prod->d_id;
     if (isset($user) && !is_null($user)) {
         $prodExpired = CacheManager::getExpireByCache(CacheManager::CACHE_PARAM_EXPIRED_USER);
         CacheManager::setValueToCache($key, $user, $prodExpired);
     }
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:8,代码来源:CacheManager.php


注:本文中的CacheManager::setValueToCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。