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


PHP ts_cache函數代碼示例

本文整理匯總了PHP中ts_cache函數的典型用法代碼示例。如果您正苦於以下問題:PHP ts_cache函數的具體用法?PHP ts_cache怎麽用?PHP ts_cache使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: getDataTemp

 function getDataTemp($share)
 {
     $typeId = $share['typeId'];
     $cache = ts_cache('share_types');
     if (empty($cache)) {
         $cache = type_cache();
     }
     $temp = $cache[$typeId]['temp_list'];
     $data = unserialize($share['data']);
     $list_data = array_merge($share, $data);
     unset($list_data['data']);
     //dump($share);
     if ($temp) {
         foreach ($list_data as $k => $v) {
             //替換
             $v = h($v);
             $temp = str_replace('{' . $k . '}', $v, $temp);
         }
         $temp = str_replace('{WR}', SITE_URL, $temp);
         $temp = str_replace('{SITE_URL}', SITE_URL, $temp);
         return $temp;
     } else {
         return '';
     }
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:25,代碼來源:ShareTypeModel.class.php

示例2: getChoiceList

 function getChoiceList()
 {
     //$arrApps = ts_cache('applist');
     if ($arrApps) {
         return $arrApps;
     } else {
         $map["status"] = array('in', array(0, 1));
         $list = $this->where($map)->order('order2 asc')->findAll();
         foreach ($list as $key => $val) {
             $APP_URL = str_replace('http://{APPS_URL}', SITE_URL . '/apps', $val['url']);
             $appid = $val['id'];
             $applist[$appid]['url'] = $APP_URL . '/' . $val['url_exp'];
             $applist[$appid]['uid_url'] = str_replace('http://{APP_URL}', $APP_URL, $val['uid_url']);
             $applist[$appid]['add_url'] = str_replace('http://{APP_URL}', $APP_URL, $val['add_url']);
             $applist[$appid]['icon'] = str_replace('http://{APP_URL}', $APP_URL, $val['icon']);
             $applist[$appid]['id'] = $val['id'];
             $applist[$appid]['name'] = $val['name'];
             $applist[$appid]['enname'] = $val['enname'];
             $applist[$appid]['place'] = $val['place'];
             $applist[$appid]['canvas_url'] = $val['type'];
             $applist[$appid]['add_name'] = $val['add_name'];
             $applist[$appid]['status'] = $val['status'];
         }
         ts_cache('applist', $applist);
         return $applist;
     }
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:27,代碼來源:AppLwModel.class.php

示例3: _initialize

 /**
  * _initialize
  * 初始化函數
  *
  * 初始化數據模型,用戶ID
  * @param string $aArgs 參數說明
  * @access public
  * @return void
  */
 public function _initialize()
 {
     $this->model = D('Share');
     $this->Cmodel = D('ShareType');
     $this->types = ts_cache('share_types');
     if (empty($this->types)) {
         $this->types = type_cache();
     }
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:18,代碼來源:BaseAction.class.php

示例4: updateCache

 function updateCache()
 {
     $data = $this->where("appname='thinksns'")->findAll();
     foreach ($data as $k => $v) {
         $opts[$v["name"]] = $v["value"];
     }
     //緩存起來
     ts_cache("site_options", $opts);
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:9,代碼來源:OptionModel.class.php

示例5: getC

function getC($name)
{
    $config = ts_cache('gift_config');
    if (empty($value[$name])) {
        $config = D('AppConfig')->getConfig();
        ts_cache('gift_config', $config);
    }
    return $config[$name];
}
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:9,代碼來源:common.php

示例6: getGuestPopedom

 function getGuestPopedom()
 {
     $list = ts_cache('guestpopedom');
     if (!$list) {
         $list = $this->getNodeList(0);
         ts_cache('guestpopedom', $list);
     }
     return $list;
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:9,代碼來源:SystemNodeLwModel.class.php

示例7: getCreditType

 public function getCreditType()
 {
     $cache = ts_cache('credit_type');
     if (!$cache) {
         $cache = $this->getAllType();
         //存儲緩存
         ts_cache('credit_type', $cache);
     }
     return $cache;
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:10,代碼來源:CreditSettingLwModel.class.php

示例8: render

 public function render($data)
 {
     $bq_emotion = ts_cache('smile_mini');
     $data['next'] = "下一頁";
     $data['prev'] = "上一頁";
     $data['perpage'] = 10;
     $data['bq_emotion'] = $bq_emotion;
     $content = $this->renderFile("Comment", $data);
     return $content;
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:10,代碼來源:CommentWidget.class.php

示例9: getSmile

 public function getSmile($type)
 {
     $smile = ts_cache("smile_mini");
     if ($smile) {
         return $smile;
     } else {
         $data = $this->where("type='mini'")->findAll();
         return $data;
         //return $this->setCache( $data,$type );
     }
 }
開發者ID:weiphpdev,項目名稱:xindongfang,代碼行數:11,代碼來源:SmileModel.class.php

示例10: get

 function get()
 {
     $opts = ts_cache("site_options");
     if (!$opts) {
         $map['appname'] = 'thinksns';
         $data = $this->where($map)->findAll();
         foreach ($data as $k => $v) {
             $opts[$v["name"]] = $v["value"];
         }
         //緩存起來
         ts_cache("site_options", $opts);
     }
     return $opts;
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:14,代碼來源:OptionLwModel.class.php

示例11: replaceContent

 /**
  * replaceContent
  * 替換內容
  * @param mixed $content
  * @access private
  * @return void
  */
 private function replaceContent($content, $type)
 {
     //TODO 每一個應用可以應用一套表情
     $path = __PUBLIC__ . "/images/biaoqing/mini/";
     //路徑
     $smile = ts_cache("smile_mini");
     //循環替換掉文本中所有ubb表情
     foreach ($smile as $value) {
         $img = sprintf("<img title='%s' src='%s%s'>", $value['title'], $path, $value['filename']);
         $content = str_replace($value['emotion'], $img, $content);
     }
     return $content;
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:20,代碼來源:CommentLwModel.class.php

示例12: _setCache

 /**
  * _setCache 
  * 設置緩存
  * @param mixed $id 
  * @param mixed $uid 
  * @access private
  * @return void
  */
 private function _setCache()
 {
     $this->_cache['endTime'] = time() + self::$lefttime;
     return ts_cache(self::$type . 'browse', $this->_cache);
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:13,代碼來源:BrowseBehavior.class.php

示例13: setCache

 public function setCache()
 {
     $cache = $this->getAllType();
     //存儲緩存
     ts_cache('credit_type', $cache);
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:6,代碼來源:CreditTypeModel.class.php

示例14: upCache

 protected function upCache()
 {
     ts_cache('applist', '');
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:4,代碼來源:AppManageAction.class.php

示例15: dobackup

 function dobackup()
 {
     $volume = isset($_GET['volume']) ? intval($_GET['volume']) + 1 : 1;
     $filename = date('ymd') . '_' . substr(md5(uniqid(rand())), 0, 10);
     $tables = array();
     $type = $_REQUEST['type'];
     if ($type == 'all') {
         //備份所有數據
         $tables = D('BackUp')->getTableList();
         $tables = D('BackUp')->arraykey($tables, 'Name');
     } elseif ($type == 'custom') {
         if ($_POST['setup']) {
             $tables = empty($_REQUEST['tablecustom']) ? array() : $_REQUEST['tablecustom'];
             ts_cache('tablecustom', $tables);
             //放入緩存
         } else {
             $tables = ts_cache('tablecustom');
         }
     }
     $filename = trim($_REQUEST['filename']) ? trim($_REQUEST['filename']) : $filename;
     $startfrom = intval($_REQUEST['startform']);
     $tableid = intval($_REQUEST['tableid']);
     $sizelimit = intval($_REQUEST['sizelimit']) ? intval($_REQUEST['sizelimit']) : 1000;
     $tablenum = count($tables);
     $filesize = $sizelimit * 1000;
     $complete = true;
     $tabledump = '';
     if ($tablenum == 0) {
         $this->error('請選擇備份的表');
     }
     for (; $complete && $tableid < $tablenum && strlen($tabledump) + 500 < $filesize; $tableid++) {
         $sqlDump = D('BackUp')->sqlDumpTable($tables[$tableid], $startfrom, $filesize, strlen($tabledump), $complete);
         $tabledump .= $sqlDump['tabledump'];
         $complete = $sqlDump['complete'];
         $startfrom = intval($sqlDump['startform']);
         if ($complete) {
             $startfrom = 0;
         }
     }
     !$complete && $tableid--;
     if (trim($tabledump)) {
         $filepath = './data/database/' . $filename . "_{$volume}" . '.sql';
         $fp = @fopen($filepath, 'wb');
         if (!fwrite($fp, $tabledump)) {
             //$this->error('文件目錄寫入失敗');
         } else {
             $url = __APP__ . "/Expert/dobackup/filename/{$filename}/type/{$type}/sizelimit/{$sizelimit}/tableid/{$tableid}/startform/{$startfrom}/volume/{$volume}";
             file_put_contents('1.txt', $url);
             //header('Location:$ur;');
             $this->assign('jumpUrl', $url);
             $this->success("備份第{$volume}卷成功");
         }
     } else {
         $url = __APP__ . "/Expert/backup";
         $this->assign('jumpUrl', $url);
         $this->success("備份成功");
     }
 }
開發者ID:wangping1987,項目名稱:dhfriendluck,代碼行數:58,代碼來源:ExpertAction.class.php


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