Coder Social home page Coder Social logo

Comments (7)

big-dream avatar big-dream commented on June 2, 2024

未复现,是不是 Redis 服务器版本太低。这边用的 Redis Server 7.0.0 测试

from framework.

big-dream avatar big-dream commented on June 2, 2024

测试代码:

$user = \app\model\User::find(1);
$user->save(['name' => 'jwj01']);

from framework.

big-dream avatar big-dream commented on June 2, 2024

已复现,代码:

$user = User::cache('key',60,'tagName')->find(1);
$user->save(['name' => 'jwj' . rand(1000, 9999)]);

清除缓存标签时,如果标签内的 keys 为空则会触发报错

from framework.

ZoftTy avatar ZoftTy commented on June 2, 2024

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.

ZoftTy avatar ZoftTy commented on June 2, 2024

wontfix 是无法修复的意思嘛

from framework.

big-dream avatar big-dream commented on June 2, 2024

wontfix 是无法修复的意思嘛

弄错标签了

from framework.

ZoftTy avatar ZoftTy commented on June 2, 2024

什么时候合并呀呀呀呀

from framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.