最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
thinkphp5redis缓存新增方法代码实例
时间:2022-06-25 02:11:25 编辑:袖梨 来源:一聚教程网
本篇文章小编给大家分享一下thinkphp5redis缓存新增方法代码实例,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
找到该文件
thinkphp/library/think/cache/driver/Redis.php
进行新增方法
在这里就举例几个 如何添加 添加的方法查看 redis教程
/**
* 返回列表中指定区间内的元素
* */
public function lrange($key,$start,$end){
return $this->handler->lrange($key,$start,$end);
}
/**
* 在list左边新增元素
* */
public function lpush($key,$value){
return $this->handler->lPush($key,$value);
}
/**
* 在list右边新增元素
* */
public function rpush($key,$value){
return $this->handler->rPush($key,$value);
}
/**
* 返回并移除列表中的第一个元素
* */
public function lpop($key){
return $this->handler->lPop($key);
}
/**
* 返回并移除列表的最后一个元素。
* */
public function rpop($key){
return $this->handler->rPop($key);
}
如果还需要添加其他的方法 根据手册某个方法以及传值
去修改$this->handler-> 后面的方法函数
相关文章
- 《万物皆可蟹:动物进化》万毒盾反流玩法技巧分享 08-03
- 1-75级抖音需要刷多少钱-抖音1-75级价目表 08-03
- 可可漫画官网客户端下载入口怎么进?可可漫画官网下载直达 08-03
- 微博网页版访问入口-微博电脑版官方登录页面入口地址 08-03
- Pragmata 在您所在时区何时发布 08-03
- 修修漫画在线看漫画入口页面-修修漫画网页版在线观看入口 08-03
