PHPackages                             teamone/cache - 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. teamone/cache

ActiveLibrary[Caching](/categories/caching)

teamone/cache
=============

Teamone Cache

v1.0.2(2y ago)05Apache-2.0PHP

Since Mar 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/teamone-cn/teamone-cache)[ Packagist](https://packagist.org/packages/teamone/cache)[ RSS](/packages/teamone-cache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Teamone Cache
=============

[](#teamone-cache)

RedisCache 是一个基于 Redis 的缓存组件，用于在 PHP 应用程序中进行数据缓存。 该组件提供了一系列方法来方便地存储、获取、删除缓存数据，并支持设置缓存过期时间、递增、递减操作等功能。

主要特性：
-----

[](#主要特性)

1. 灵活的缓存管理：通过 RedisCache 组件，可以轻松地在应用程序中管理缓存数据，包括设置缓存、获取缓存、删除缓存等操作。
2. 多实例支持：RedisCache 支持同时管理多个 Redis 实例的缓存数据，通过配置不同的连接实例名称，在应用程序中灵活切换不同的 Redis 实例。
3. 多项操作支持：提供了一次性操作多个缓存项的方法，可以有效地减少与 Redis 的交互次数，提升性能。
4. 前缀支持：支持为缓存数据设置前缀，可以在一个 Redis 实例中管理多个缓存数据集合，避免键名冲突。

接入指南
----

[](#接入指南)

```
public function test(): void
{
    $configs = [
        "default" => [
            'driver'         => RedisConnector::class,
            'host'           => 'redis.jukit.loc',
            'port'           => 6379,
            'timeout'        => 3.0,
            'retry_interval' => 1000, // 重试间隔，单位为毫秒。
            'read_timeout'   => 0,
            'username'       => null,
            'password'       => '123456',
            'database'       => 0,
            'prefix'         => 'default:',
            'name'           => 'Redis',
            'wait_timeout'   => 5, // 连接失败时，等待多久时间重新连接
        ],
        "queue"   => [
            'driver'         => RedisConnector::class,
            'host'           => 'redis.jukit.loc',
            'port'           => 6379,
            'timeout'        => 3.0,
            'retry_interval' => 1000, // 重试间隔，单位为毫秒。
            'read_timeout'   => 0,
            'username'       => null,
            'password'       => '123456',
            'database'       => 1,
            'prefix'         => 'queue:',
            'name'           => 'Redis',
            'wait_timeout'   => 5, // 连接失败时，等待多久时间重新连接
        ],
        "cache"   => [
            'driver'         => RedisConnector::class,
            'host'           => 'redis.jukit.loc',
            'port'           => 6379,
            'timeout'        => 3.0,
            'retry_interval' => 1000, // 重试间隔，单位为毫秒。
            'read_timeout'   => 0,
            'username'       => null,
            'password'       => '123456',
            'database'       => 0,
            'prefix'         => 'cache:',
            'name'           => 'Redis',
            'wait_timeout'   => 5, // 连接失败时，等待多久时间重新连接
        ],
    ];

    $manager = new RedisManager($configs);

    $redisCache = new RedisCachePsr($manager, "cache", "");

    $redisCache = $redisCache;

    $result = $redisCache->redisCache->put("k1", null, 60);
    var_dump($result);

    $result = $redisCache->redisCache->put("k2", "", 60);
    var_dump($result);

    $result = $redisCache->redisCache->put("k3", "v3", 60);
    var_dump($result);
}
```

单元测试
----

[](#单元测试)

```
./vendor/bin/phpunit ./test/RedisCacheTest.php --filter testPut$
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~11 days

Total

3

Last Release

767d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6eb5ed3739a1c5fcc298dae4e784024553b641e74445cac72d29d12e2f66b409?d=identicon)[teamone](/maintainers/teamone)

---

Top Contributors

[![Jukit-Barrett](https://avatars.githubusercontent.com/u/14925130?v=4)](https://github.com/Jukit-Barrett "Jukit-Barrett (3 commits)")[![teamone-cn01](https://avatars.githubusercontent.com/u/124553729?v=4)](https://github.com/teamone-cn01 "teamone-cn01 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/teamone-cache/health.svg)

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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