PHPackages                             mantoufan/yzhancache - 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. mantoufan/yzhancache

ActiveLibrary[Caching](/categories/caching)

mantoufan/yzhancache
====================

Simple, effient cache class for PHP. 简单、高效的 PHP 缓存类

1.0.0(3y ago)341.5k2MITPHPPHP &gt;=5.4

Since Sep 16Pushed 3y ago1 watchersCompare

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

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

yzhanCache
==========

[](#yzhancache)

Simple, effient cache class for PHP.
简单、高效的 PHP 缓存类

Install 安装
----------

[](#install-安装)

```
composer require mantoufan/yzhancache
```

Use 使用
------

[](#use-使用)

```
$yzhanCache = new YZhanCache('File'); // Default: File Engine
```

### File Engine Only: Change Cache Dir

[](#file-engine-only-change-cache-dir)

```
$yzhanCache = new YZhanCache('File', array(
  'dir' => sys_get_temp_dir() . '/yzhancache' // Default Cache Dir
));
```

### Set 设置

[](#set-设置)

```
$yzhanCache->set($key, $val, $maxAge = null); // Unit of $maxAge is seconds
$yzhanCache->set('1', 'a', 1)->set('2', array(1, 2, 3)) // Chain call
```

### Get 获取

[](#get-获取)

```
$yzhanCache->get($key);
$yzhanCache->get('1'); // a
$yzhanCache->get('2'); // [1, 2, 3]
$yzhanCache->get('1'); // null, expires over $maxAge
```

### Has 是否存在

[](#has-是否存在)

```
$yzhanCache->has($key); // true / false
```

### Delete 删除

[](#delete-删除)

```
$yzhanCache->delete($key);
$yzhanCache->set('1', 'a')->delete('1'); // Chain call
```

### Clear 清空

[](#clear-清空)

```
$yzhanCache->clear();
$yzhanCache->clear()->set('1', 'a')->delete('1'); // Chain call
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

1334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/186219fca45bab5c5266d7c1f22c79c217f21ba7ada3142795a8ae69f95be0f6?d=identicon)[mantoufan](/maintainers/mantoufan)

---

Top Contributors

[![mantoufan](https://avatars.githubusercontent.com/u/4961543?v=4)](https://github.com/mantoufan "mantoufan (9 commits)")[![yzwaa](https://avatars.githubusercontent.com/u/138418726?v=4)](https://github.com/yzwaa "yzwaa (3 commits)")

---

Tags

cachefile

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mantoufan-yzhancache/health.svg)

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

###  Alternatives

[lochmueller/staticfilecache

Transparent static file cache solution using mod\_rewrite and mod\_expires. Increase performance for static pages by a factor of 230!!

1311.3M3](/packages/lochmueller-staticfilecache)[matomo/cache

PHP caching library based on Doctrine cache

38854.1k4](/packages/matomo-cache)[vink/nova-cache-card

Manage your application's cache from a handy Laravel Nova dashboard card.

26317.3k1](/packages/vink-nova-cache-card)[garyr/memento

Lightweight cache library

186.6k1](/packages/garyr-memento)[bnomei/kirby3-redis-cachedriver

Advanced Redis cache-driver with in-memory store, transactions and preloading

101.7k](/packages/bnomei-kirby3-redis-cachedriver)

PHPackages © 2026

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