https://github.com/v10086/redis
redis操作句柄
https://github.com/v10086/redis
php phpredis redis
Last synced: 2 months ago
JSON representation
redis操作句柄
- Host: GitHub
- URL: https://github.com/v10086/redis
- Owner: v10086
- Created: 2020-04-08T16:21:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T15:21:00.000Z (about 5 years ago)
- Last Synced: 2025-07-23T12:23:03.915Z (9 months ago)
- Topics: php, phpredis, redis
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
📃 开源协议 Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html
# 简介
基于phpreis拓展开发的简约、高效、可靠的Redis操作句柄
支持断线自动重连功能
版本说明
--------------------------------------------------------------------------
PHP7.0+版本 必须安装phpredis拓展
安装教程
--------------------------------------------------------------------------
composer require v10086/redis:v1.0
使用示例
--------------------------------------------------------------------------
```php
[
'host' => 'redis',//地址
'port' => '6379',//端口
'password' =>'pass',//密码
'persistent' =>TRUE, //是否长连接 true 是 false 否
'timeout'=>FALSE
],
'other'=>[
'host' => 'other_redis',//地址
'port' => '6379',//端口
'password' =>'other_pass',//密码
'persistent' =>TRUE, //是否长连接 true 是 false 否
'timeout'=>FALSE
],
];
//默认default 可设置为其他配置
\v10086\Redis::connection('default');
//句柄所具备的操作函数跟redis官方所提供的命令一致,可到redis官网查阅
\v10086\Redis::set('key','val');
\v10086\Redis::get('key');
```