targetliu/phpredis

该软件包的最新版本(1.2.1)没有提供许可信息。

Lumen 5.* 的 PhpRedis

1.2.1 2016-09-20 09:53 UTC

This package is not auto-updated.

Last update: 2024-09-20 23:33:57 UTC


README

更新

1.2.1

  1. 不同的数据库使用不同的连接。(根据 问题 #2

1.2.0

  1. 您可以选择不同的 Redis 连接。(根据 问题 #1

1.1.0

  1. 将缓存驱动器移动到 Target\PHPRedis\Cache .
  2. 添加队列驱动器。

安装

  • 安装 PhpRedis
  • 运行 composer require targetliu/phpredis
  • .env 中配置 redis

基本

  • bootstrap/app.php 中添加 $app->register(TargetLiu\PHPRedis\PHPRedisServiceProvider::class);

缓存驱动器

  • 为了使用 PhpRedis 与 Lumen 缓存,在 bootstrap/app.php 中添加 $app->register(TargetLiu\PHPRedis\Cache\CacheServiceProvider::class);
  • 添加
'phpredis' => [
    'driver' => 'phpredis',
    'connection' => 'default',
],

stores 中,在 config/cache.phpvendor/laravel/lumen-framework/config/app.php 中,以使用 PhpRedis 与 Lumen 缓存

  • .env 中设置 CACHE_DRIVER=phpredis

队列驱动器

  • 为了使用 PhpRedis 与 Lumen 队列,在 bootstrap/app.php 中添加 $app->register(TargetLiu\PHPRedis\Queue\QueueServiceProvider::class);
  • 添加
'phpredis' => [
    'driver'     => 'phpredis',
	'connection' => 'default',
	'queue'      => 'default',
	'expire'     => 60,
],

connections 中,在 config/queue.phpvendor/laravel/lumen-framework/config/queue.php 中,以使用 PhpRedis 与 Lumen 队列

  • .env 中设置 QUEUE_DRIVER=phpredis

用法

关于作者