PHPackages                             axguowen/redis-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. axguowen/redis-client

ActiveLibrary[Caching](/categories/caching)

axguowen/redis-client
=====================

Simple PHP Redis Client Library

v1.0.4(1y ago)034Apache-2.0PHPPHP &gt;=5.6.0

Since May 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/axguowen/redis-client)[ Packagist](https://packagist.org/packages/axguowen/redis-client)[ RSS](/packages/axguowen-redis-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

PHP Redis 客户端管理器
================

[](#php-redis-客户端管理器)

一个简单的 PHP Redis 客户端连接管理工具

安装
--

[](#安装)

```
composer require axguowen/redis-client

```

使用
--

[](#使用)

### 配置连接

[](#配置连接)

```
use \axguowen\facade\RedisClient;

// Redis服务器配置信息设置（全局有效）
RedisClient::setConfig([
    // 默认连接本机
    'default' => 'localhost',
    // 连接配置
    'connections' => [
        // 本机连接参数
        'localhost' => [
            // 主机
            'host'              => '127.0.0.1',
            // 端口
            'port'              => 6379,
            // 密码
            'password'          => '',
            // 数据库索引
            'select'            => 0,
            // 超时时间
            'timeout'           => 0,
            // 是否是长链接
            'persistent'        => false,
            // 部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
            'deploy'            => 0,
            // 读写是否分离 主从式有效
            'rw_separate'       => false,
            // 读写分离后 主服务器数量
            'master_num'        => 1,
            // 指定从服务器序号
            'slave_no'          => '',
            // 有数据写入后自动读取主服务器
            'read_master'       => false,
            // 是否需要断线重连
            'break_reconnect'   => false,
            // 断线标识字符串
            'break_match_str'   => [],
            // 键名构建器类
            'builder'           => '',
        ],
        // 其它主机连接参数
        'other' => [
            // 主机
            'host' => '192.168.0.2',
            // 端口
            'port' => 6379,
            // 密码
            'password' => 'XXXXXX',
            // 数据库索引
            'select' => 0,
            // 超时时间
            'timeout' => 1
        ],
    ]
]);
```

### 简单使用

[](#简单使用)

```
use \axguowen\facade\RedisClient;
// 默认本机
$ping = RedisClient::ping();
// 连接其它服务器
$pingOther = RedisClient::connect('other')->ping();

// set方法
$setKey = RedisClient::set('mykey', 'myvalue');
// 连接其它服务器
$setKeyOther = RedisClient::connect('other')->set('mykey', 'myvalue');
```

### 使用键名构造器

[](#使用键名构造器)

```
use \axguowen\facade\RedisClient;

$mykey = RedisClient::key('mykey');

// 设置值
$mykey->set('myvalue');
$value = $mykey->get();
var_dump($value);

// 将当前值改成其它值
$mykey->set('othervalue');
$value = $mykey->get();
var_dump($value);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance40

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Total

5

Last Release

713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bb2b3388238042a25cf42dc44e5ff84adc241510354abae9e91573556753205?d=identicon)[axguowen](/maintainers/axguowen)

---

Top Contributors

[![axguowen](https://avatars.githubusercontent.com/u/61955804?v=4)](https://github.com/axguowen "axguowen (10 commits)")

---

Tags

phpclientredis

### Embed Badge

![Health badge](/badges/axguowen-redis-client/health.svg)

```
[![Health](https://phpackages.com/badges/axguowen-redis-client/health.svg)](https://phpackages.com/packages/axguowen-redis-client)
```

###  Alternatives

[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[swoft/redis

swoft redis component

12168.4k16](/packages/swoft-redis)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
