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


PHP cache::put方法代码示例

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


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

示例1: get_group_list

 public function get_group_list()
 {
     global $_M;
     if (!$this->grouplist[$this->lang]) {
         $this->grouplist[$this->lang] = cache::get("user/grouplist_{$this->lang}");
         if (!$this->grouplist[$this->lang]) {
             $query = "SELECT * FROM {$_M['table']['user_group']} WHERE lang='{$this->lang}' order by access ASC";
             $result = DB::query($query);
             while ($list = DB::fetch_array($result)) {
                 $this->grouplist[$this->lang][$list['id']] = $list;
             }
             cache::put("user/grouplist_{$this->lang}", $this->grouplist[$this->lang]);
         }
     }
     return $this->grouplist[$this->lang];
 }
开发者ID:nanfs,项目名称:lt,代码行数:16,代码来源:group.class.php

示例2: get_para_list

 public function get_para_list($module, $class1, $class2, $class3)
 {
     global $_M;
     if (!$this->paralist[$module][$this->lang]) {
         $this->paralist[$module][$this->lang] = cache::get("para/paralist_{$module}_{$this->lang}");
         if (!$this->paralist[$module][$this->lang]) {
             $query = "SELECT * FROM {$_M['table']['parameter']} WHERE module='{$module}' and lang='{$_M['lang']}' order by no_order ASC, id ASC";
             $result = DB::query($query);
             while ($list = DB::fetch_array($result)) {
                 if ($list['options']) {
                     $lists = explode("\$|\$", $list['options']);
                     $list['list'] = $lists;
                 }
                 $this->paralist[$module][$this->lang][$list['id']] = $list;
             }
             cache::put("para/paralist_{$module}_{$this->lang}", $this->paralist[$module][$this->lang]);
         }
     }
     $re = $this->paralist[$module][$this->lang];
     $paralists = array();
     foreach ($re as $val) {
         if ($val['class1']) {
             if ($val['class1'] == $class1) {
                 if ($val['class2'] == 0 && $val['class3'] == 0) {
                     $paralists[] = $val;
                 }
                 if ($val['class2'] && $val['class2'] == $class2 && $val['class3'] == 0) {
                     $paralists[] = $val;
                 }
                 if ($val['class3'] && $val['class3'] == $class3) {
                     $paralists[] = $val;
                 }
             }
         } else {
             $paralists[] = $val;
         }
     }
     $re = $paralists;
     return $re;
 }
开发者ID:nanfs,项目名称:lt,代码行数:40,代码来源:para.class.php

示例3: curl_multi_get

 public static function curl_multi_get($requests)
 {
     cache::$__LinkToFunc = array();
     cache::$__TempResult = array();
     cache::$__ApiTime = microtime(true);
     $rc = new RollingCurl(function ($response, $info, $request) {
         $url = $request->url;
         if ($response == null) {
             cache::log("CURL RESULT EMPTY for url: " . $url . " with HTTP code " . $info['http_code']);
             /*$response = file_get_contents($url);
             		
             		if( $response == false )
             		{
             			cache::log("FILE_GET_CONTENTS failed for url: ".$url);
             		}*/
         }
         cache::log(sprintf("Got multi result for %s in %s sec, len %s", $url, number_format(microtime(true) - cache::$__ApiTime, 3), strlen($response)));
         $cbtime = microtime(true);
         if (cache::$__LinkToFunc[$url]) {
             call_user_func_array(cache::$__LinkToFunc[$url], array($response));
         }
         cache::log(sprintf("Ran callback for URL in %s sec", number_format(microtime(true) - $cbtime, 3)));
         cache::$__TempResult[$url] = $response;
         cache::put($url, $response);
     });
     foreach ($requests as $request) {
         cache::$__LinkToFunc[$request['url']] = $request['func'];
         $rc->request($request['url']);
     }
     $rc->window_size = count($requests);
     $rc->execute();
     cache::log(sprintf("Multi API request took %s sec", number_format(microtime(true) - cache::$__ApiTime, 3)));
     return cache::$__TempResult;
 }
开发者ID:mwilchez,项目名称:master,代码行数:34,代码来源:cache.php


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