Comments (7)
未复现,是不是 Redis
服务器版本太低。这边用的 Redis Server 7.0.0
测试
from framework.
测试代码:
$user = \app\model\User::find(1);
$user->save(['name' => 'jwj01']);
from framework.
已复现,代码:
$user = User::cache('key',60,'tagName')->find(1);
$user->save(['name' => 'jwj' . rand(1000, 9999)]);
清除缓存标签时,如果标签内的 keys
为空则会触发报错
from framework.
redis version: 7.2.4
删除 phpredis 扩展,使用 https://github.com/predis/predis
使用测试代码
// 模型
class SmsCodeModel extends Model
{
protected $table = 'sms_code';
}
$code = SmsCodeModel::find(1);
$code->save(['code' => 123456]);
cache 配置
return [
// 默认缓存驱动
'default' => 'redis',
// 缓存连接方式配置
'stores' => [
'file' => [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
// 更多的缓存连接
'redis' => [
// 驱动方式
'type' => 'redis',
// 服务器地址
'host' => env('REDIS_HOST', '127.0.0.1'),
// 端口
'port' => env('REDIS_PORT', 6379),
// 密码
'password' => env('REDIS_PASSWORD', ''),
],
],
];
from framework.
wontfix 是无法修复的意思嘛
from framework.
wontfix 是无法修复的意思嘛
弄错标签了
from framework.
什么时候合并呀呀呀呀
from framework.
Related Issues (20)
- 多个模型定义全局查询范围的时候使用join会报错的问题 HOT 1
- cache组件并发下,如果不设置模型字段缓存,会经常把报错 HOT 1
- 关于trace调试窗口的疑问 HOT 2
- 关于安卓13+Termux环境部署上的一些小问题 HOT 1
- 請問為何我使用Termux 卻帶不出手機裡已安裝的app list?
- composer安装不了thinkphp8 HOT 1
- TP8不支持 form-data 格式的请求数据吗?只支持 x-www-form-urlencoded ? HOT 3
- 8.0.3 路由跨域设置 不生效
- StyleCi 规则草案讨论
- The memory overflow problem exists in the framework of versions later than 8.0.0 HOT 5
- Reflected XSS(Cross Site Scripting) HOT 1
- 框架加载配置文件期间的异常无法捕获
- 编辑器提示存在漏洞 HOT 1
- Log::getLog()获取不到日志内容 HOT 1
- composer安装thinkphp8安装失败 HOT 3
- cache 使用redis,并使用getex指令,无法获取前缀 HOT 1
- tp8的session机制改变了吗? HOT 2
- Validate对于有序数组的校验
- 简单的一个测试就报错?是我小白,还是? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.