sframe / redis
redis 组件
dev-master
2014-11-23 12:30 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-24 03:08:03 UTC
README
基于 php_redis 扩展的 Redis 管理器 支持通过配置支持主从模式
安装
composer require "sframe/redis:*"
配置
1 服务器
array( 'host' => '', // optional, default 127.0.0.1 'port' => '', // optional, default 6379 'timeout' => 0, // optional, default 0 'persistent' => false, // optional, default false )
1 主节点和 1 个从节点
array( 'master' => array( ... ), 'slave' => array( ... ) )
1 个主节点和多台从节点
array( 'master' => array( ... ), 'slaves' => array( array(...), array(...), ... ) )
demo.php
$redis = new \SFrame\Redis\Redis(); $redis->set('hello', 1); $redis->get('hello'); $redis->delete('hello'); ...