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

ActiveLibrary[Caching](/categories/caching)

yzh52521/symfony-cache
======================

description

v1.0.2(3y ago)3122Apache-2.0PHPPHP &gt;=7.4

Since Mar 14Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

symfony cache for webman

安装
--

[](#安装)

```
composer require yzh52521/symfony-cache
```

配置文件
----

[](#配置文件)

config/cache.php

支持驱动
----

[](#支持驱动)

- apc
- array
- file 本地缓存
- redis 缓存
- memcached 缓存
- database 数据库缓存

示例
--

[](#示例)

```
namespace app\controller;

use support\Request;
use yzh52521\SymfonyCache\Cache;

class UserController
{
    public function db(Request $request)
    {
        $key = 'test_key';
        Cache::set($key, rand());
        return response(Cache::get($key));
    }

}
```

访问多个缓存存储
--------

[](#访问多个缓存存储)

```
$value = Cache::store('file')->get('foo');

Cache::store('redis')->set('bar', 'baz', 600); // 10 Minutes
```

从缓存中检索
------

[](#从缓存中检索)

```
$value = Cache::get('key');

$value = Cache::get('key', 'default');
```

检查是否存在
------

[](#检查是否存在)

```
if (Cache::has('key')) {
    //
}
```

删除
--

[](#删除)

```
Cache::delete('key');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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 ~2 days

Total

3

Last Release

1152d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15060466?v=4)[听风吹雨](/maintainers/yuanzhihai)[@yuanzhihai](https://github.com/yuanzhihai)

---

Top Contributors

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

---

Tags

symfonycachesymfony-cachewebmanwebman-cache

### Embed Badge

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

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

###  Alternatives

[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)

PHPackages © 2026

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