2017 © Pedro Peláez
 

library think-redissentinel

redis sentinel driver for thinkphp5

image

naixiaoxin/think-redissentinel

redis sentinel driver for thinkphp5

  • Thursday, September 15, 2016
  • by qiqizjl
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ThinkPHP 5.0 Redis Sentinel驱动

首先安装官方的php-redis扩展:, (*1)

http://pecl.php.net/package/redis, (*2)

然后,配置应用的配置文件config.phpcache['type']参数为:, (*3)

'type'  =>  '\think\sentinel\Sentinel',

并增加一下参数 cache['server']:(是个数组,host是地址,port是端口号):, (*4)

'servers'=>[
    0=>[
        'host'=>'127.0.0.1',
         'port'=>'26379'
    ],
    1=>[
        'host'=>'127.0.0.1',
        'port'=>'26380'
    ]
],

cache['name']:是哨兵的名字, (*5)

'name'  =>  'mymaster',

即可正常使用Sentinel,例如:, (*6)

Cache::get('test');
Cache::get('test','test');

The Versions

15/09 2016

dev-master

9999999-dev

redis sentinel driver for thinkphp5

  Sources   Download

Apache-2.0

by NaiXiaoXin