var_export 掉咋天
2024-09-29 09:35:05
var_export 文件缓存经常使用 输出或返回一个变量的字符串表示
- /**
- * 写入缓存
- *
- * @param string $id
- * @param mixed $data
- * @param array $policy
- */
- public function set($mode, $id, $data, $expired = -1)
- {
- if( empty($mode) || empty($id) ){return false;}
- $path = $this->getComFilename($mode ,$id);
- $expired = ($expired < 0) ? -1 : time() + $expired;
- $content = array(
- 'expired' => $expired,
- 'data' => $data,
- );
- $content = '<?php return ' . var_export($content, true) . ';';
- // 写入缓存,并去掉多余空格
- file_put_contents($path, $content, LOCK_EX);
- // file_put_contents($path, php_strip_whitespace($path), LOCK_EX);
- clearstatcache();
- $this->_cachelist($path,$mode);//写缓存列表文件
- return true;
- }
最新文章
- Graph cuts图论分割
- Spring mvc框架 controller间跳转 ,重定向 ,传参
- Bootstrap_按钮工具栏
- UDP网络通信OSC 协议
- 重构第17天提取父类(Extract SuperClass)
- 删除ecshop登录后台看到的系统信息
- Delphi里的RTTI与反射(举例换掉FOnChange)
- android系统的图片资源
- CoreAnimation 寄宿图
- 神奇的marquee--滚动的文字
- Python 批量翻译 使用有道api;
- Nginx和php是怎么通信的?
- Cocos2D中Action的进阶使用技巧(一)
- Python Excel 多sheet 多条数据 自定义写入
- Repository模式与UnitOfWorks模式的运用
- 新网站如何做SEO优化【转】
- Cocos2D-x-3.0 编译(Win7)
- 你都用python来做什么?
- RTX——第7章 任务管理
- c#通过webrequest请求远程http服务时出现的问题
热门文章
- HDU - 3974 Assign the task (线段树区间修改+构建模型)
- python-常用数据类型
- 微信小程序,错误{";errMsg";:";request:fail 小程序要求的 TLS 版本必须大于等于 1.2";}
- mac怎么快速回到桌面 隐藏所有窗口
- Python中json一点小知识
- 微信小程序开发(2) 计算器
- idea 2018.1破解激活方法,有效期至2099年
- loj 10181 绿色通道 二分答案+单调队列DP
- dubbo 初探
- steps/train_sat.sh