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 2w 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

21

—

LowBetter than 17% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

860d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/125951?v=4)[teamone](/maintainers/teamone)[@teamone](https://github.com/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

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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