【Laravel3.0.0源码阅读分析】memcached缓存类memcached.php
发布日期:2021-06-30 20:44:52
浏览次数:2
分类:技术文章
本文共 1032 字,大约阅读时间需要 3 分钟。
key = $key; $this->memcache = $memcache; } /** * 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) { if (($cache = $this->memcache->get($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) { $this->memcache->set($this->key.$key, $value, 0, $minutes * 60); } /** * Delete an item from the cache. * 从缓存中删除一个项 * @param string $key * @return void */ public function forget($key) { $this->memcache->delete($this->key.$key); }}
github地址:
转载地址:https://liushilong.blog.csdn.net/article/details/117429490 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月05日 16时56分08秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
2021.5.25 Flex
2019-04-30
2021.5.28 AJAX
2019-04-30
正则表达式
2019-04-30
过滤器Filter
2019-04-30
2021.6.1 Array补充
2019-04-30
【收藏】Markdown笔记
2019-04-30
离散数学-图论
2019-04-30
啊沙发沙发
2019-04-30
2021-07-02
2019-04-30
「收藏」HTML笔记-持续更新中
2019-04-30
数据结构期末复习------排序汇总
2019-04-30
数据结构期末复习------查找汇总
2019-04-30
青云QingMR集群创建、HDFS节点与Client节点管理教程
2019-04-30
Vue学习(10)————————编程式导航,地址栏的#号去掉,路由的嵌套
2019-04-30
SpringBoot内置Tomcat配置参数
2019-04-30
Nginx基本知识
2019-04-30
微服务公用实体类andLombok
2019-04-30
小问题
2019-04-30
Spring Security之旅————————————基本介绍安装(1)
2019-04-30
Spring IO Platform学习
2019-04-30