• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ts_cache函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ts_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP ts_cache函数的具体用法?PHP ts_cache怎么用?PHP ts_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ts_cache函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: setCache

 public function setCache()
 {
     $cache = $this->getAll();
     //存储缓存
     ts_cache('rank_rule', $cache);
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:6,代码来源:SystemUserRankModel.class.php


示例17: setCache

 private function setCache()
 {
     ts_cache('miniconfig', "");
     $request = $this->findAll();
     if (!$request) {
         return false;
     }
     foreach ($request as $value) {
         $result[$value['variable']] = $value['value'];
     }
     ts_cache('miniconfig', $result);
     return true;
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:13,代码来源:MiniConfigModel.class.php


示例18: ubb

function ubb($content)
{
    if (empty($content)) {
        return '';
    }
    $path = __PUBLIC__ . "/images/biaoqing/mini/";
    //路径
    //TODO 多应用表情
    $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,代码行数:16,代码来源:common.php


示例19: type_cache

function type_cache()
{
    $types = D('ShareType')->where("state=0")->order('sort asc')->findAll();
    $arr = array();
    foreach ($types as $k => $v) {
        $id = $v['id'];
        unset($v['id']);
        foreach ($v as $k1 => $v1) {
            $arr[$id][$k1] = $v1;
        }
    }
    ts_cache('share_types', $arr);
    return $arr;
}
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:14,代码来源:common.php


示例20: rebuildCache

 private function rebuildCache()
 {
     ts_cache($this->appname . 'config', "");
     $request = $this->where("appname='{$this->appname}'")->findAll();
     if (!$request) {
         return false;
     }
     foreach ($request as $value) {
         $result[$value['name']] = $value['value'];
     }
     ts_cache($this->appname . '_config', $result);
     return true;
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:13,代码来源:AppConfigModel.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ts_escape函数代码示例发布时间:2022-05-23
下一篇:
PHP ts_attr_is_false函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap