定制 vemcogroup/laravel-redis 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vemcogroup/laravel-redis

最新稳定版本:0.1.1

Composer 安装命令:

composer require vemcogroup/laravel-redis

包简介

Enhancements to redis driver, such as enabling a serializer and/or compression

README 文档

README

Latest Version on Packagist Total Downloads tests

Description

Enhancements to redis driver, such as enabling a serializer and/or compression

Installation

You can install the package via composer:

composer require vemcogroup/laravel-redis

Remember to have redis installed with serializer and compression.
Answer yes to serializer and compression.

pecl upgrade -f redis

If you are missing igbinary

pecl install igbinary

If you are missing libzstd

brew install zstd

Usage

Start by selection the new driver vredis in you .env file:

REDIS_CLIENT=vredis

Compression

To use compression you have to set the type in database.php for your redis connection:

'default' => [
    'url' => env('REDIS_URL'),
    'host' => env('REDIS_HOST', '127.0.0.1'),
    'password' => env('REDIS_PASSWORD', null),
    'port' => env('REDIS_PORT', '6379'),
    'database' => env('REDIS_DB', '0'),
    'options' => [
        'compression' => Redis::COMPRESSION_NONE,
    ],
],

You can use any of the Redis compressions available from you installation:
Redis::COMPRESSION_NONE, Redis::COMPRESSION_ZSTD, Redis::COMPRESSION_LZ4

Serializer

To use serialization you have to set the type in database.php for your redis connection:

'default' => [
    'url' => env('REDIS_URL'),
    'host' => env('REDIS_HOST', '127.0.0.1'),
    'password' => env('REDIS_PASSWORD', null),
    'port' => env('REDIS_PORT', '6379'),
    'database' => env('REDIS_DB', '0'),
    'options' => [
        'serializer' => Redis::SERIALIZER_NONE,
    ],
],

You can use any of the Redis serializers available from you installation:
Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, Redis::SERIALIZER_IGBINARY, Redis::SERIALIZER_MSGPACK, Redis::SERIALIZER_JSON

统计信息

  • 总下载量: 11.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-31