PHPackages                             boxphp/redis - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. boxphp/redis

ActiveLibrary[HTTP &amp; Networking](/categories/http)

boxphp/redis
============

BoxPHP Redis - Connection, Pool, Service Provider

1.0.0(today)00MITPHPPHP &gt;=8.1

Since Jun 27Pushed todayCompare

[ Source](https://github.com/tvjojo/boxphp-redis)[ Packagist](https://packagist.org/packages/boxphp/redis)[ RSS](/packages/boxphp-redis/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

boxphp/redis
============

[](#boxphpredis)

BoxPHP Redis 包 - Redis 连接、连接池及服务提供者

安装
--

[](#安装)

```
composer require boxphp/redis
```

前置要求
----

[](#前置要求)

- PHP Redis 扩展 (`phpredis`)

使用
--

[](#使用)

### 基础连接

[](#基础连接)

```
use BoxPHP\Redis\Redis\RedisConnection;

$redis = new RedisConnection([
    'host' => '127.0.0.1',
    'port' => 6379,
    'timeout' => 2.0,
]);

$redis->connect();
$redis->set('name', 'John');
echo $redis->get('name'); // John
```

### 连接池

[](#连接池)

```
use BoxPHP\Redis\Redis\RedisPool;

$pool = new RedisPool([
    'host' => '127.0.0.1',
    'port' => 6379,
    'pool_max_size' => 10,
]);

$redis = $pool->get();
$redis->set('key', 'value');
$pool->put($redis);
```

### 服务提供者（配合 Container）

[](#服务提供者配合-container)

```
use BoxPHP\Core\Container\Container;
use BoxPHP\Redis\Redis\RedisServiceProvider;

$container = new Container();
$provider = new RedisServiceProvider();
$provider->register($container);

// 使用
$redis = $container->make(RedisConnection::class);
```

### 支持的操作

[](#支持的操作)

```
// String
$redis->set('key', 'value');
$redis->get('key');
$redis->del('key');
$redis->incr('counter');

// Hash
$redis->hSet('user:1', 'name', 'John');
$redis->hGet('user:1', 'name');
$redis->hGetAll('user:1');

// List
$redis->lPush('queue', 'task1');
$redis->rPop('queue');
$redis->lRange('queue', 0, -1);

// Set
$redis->sAdd('tags', 'php', 'redis');
$redis->sMembers('tags');

// Pipeline
$redis->pipeline(function ($redis) {
    $redis->set('a', 1);
    $redis->set('b', 2);
    $redis->set('c', 3);
});
```

依赖
--

[](#依赖)

- PHP &gt;= 8.1
- boxphp/core ^1.0

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9910314?v=4)[tvjojo ](/maintainers/tvjojo)[@tvjojo](https://github.com/tvjojo)

---

Top Contributors

[![tvjojo](https://avatars.githubusercontent.com/u/9910314?v=4)](https://github.com/tvjojo "tvjojo (5 commits)")

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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