【Laravel3.0.0源码阅读分析】APC缓存类apc.php
发布日期:2021-06-30 20:44:47
浏览次数:2
分类:技术文章
本文共 1043 字,大约阅读时间需要 3 分钟。
key = $key; } /** * Determine if an item exists in the cache. * 确定缓存中是否存在指定键的项 * @param string $key * @return bool */ public function has($key) { return ( ! is_null($this->get($key))); } /** * Retrieve an item from the cache driver. * 从缓存驱动程序中检索项 * @param string $key * @return mixed */ protected function retrieve($key) { // apc_fetch 从缓存中获取存储的变量 if (($cache = apc_fetch($this->key.$key)) !== false) { return $cache; } } /** * Write an item to the cache for a given number of minutes. * 向缓存中写入一个带有过期时间的项 * * // Put an item in the cache for 15 minutes * Cache::put('name', 'Taylor', 15); *
* * @param string $key * @param mixed $value * @param int $minutes * @return void */ public function put($key, $value, $minutes) { // apc_store-在数据存储中缓存一个变量 apc_store($this->key.$key, $value, $minutes * 60); } /** * Delete an item from the cache. * 从缓存中删除一个项 * @param string $key * @return void */ public function forget($key) { // apc_delete 从缓存中删除存储的变量 apc_delete($this->key.$key); }}
转载地址:https://liushilong.blog.csdn.net/article/details/117429085 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
感谢大佬
[***.8.128.20]2024年04月24日 19时49分45秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
MATLAB函数备忘(定期更新)
2019-04-30
13行MATLAB代码实现网络爬虫 爬取NASA画廊星图
2019-04-30
MATLAB指定路径保存图片方法
2019-04-30
Python一键获取微信推送封面图
2019-04-30
油猴脚本:微信推送浏览功能拓展
2019-04-30
JavaScript DOM对象操作详解
2019-04-30
JavaScript 表单操作与MD5加密
2019-04-30
JAVA学习笔记4 - 循环与分支结构
2019-04-30
JAVA学习笔记6 - 数组
2019-04-30
JAVA学习笔记8 - Stream 和 File I/O
2019-04-30
JAVA学习笔记9 - 异常
2019-04-30
JAVA学习笔记10 - 继承
2019-04-30
JAVA学习笔记11 - 接口interface
2019-04-30
JAVA学习笔记12 - 包package
2019-04-30
Android 开发学习笔记 00 - Getting Started
2019-04-30
【学习笔记】Android Activity
2019-04-30
【学习笔记】Android Fragments
2019-04-30
Android使用Retrofit_00_Getting Started
2019-04-30
Android使用Retrofit_01_OAuth2 + GitHub
2019-04-30