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

ActiveLibrary[Caching](/categories/caching)

villain/cache
=============

Cache Component for PHP

v1.0.3(4y ago)1121MITPHPPHP &gt;=7.4

Since Nov 30Pushed 4y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

cache
=====

[](#cache)

PHP Cache Component

Install
-------

[](#install)

- composer command

```
composer require villain/cache
```

Example
-------

[](#example)

### MultiFile

[](#multifile)

```
$config = [
    'adapter' => 'MultiFileAdapter'
];

$cache = new Cache($config);
$cache->set('key', 'value');
```

### File

[](#file)

```
$config = [
'dataFile' => __DIR__ . '/catch.txt'
];

$cache = new Cache($config);
$cache->set('key', 'value');

var_dump($cache->get('key'));
```

### Array

[](#array)

```
$config = [];

$cache = new Cache($config);
$cache->set('key', 'value');

var_dump($cache->get('key'));
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

4

Last Release

1625d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36523c5542ad306ca3e52a477dad7408c0bd31e9aca75737f162ee0c8ff242f0?d=identicon)[VillainWen](/maintainers/VillainWen)

---

Top Contributors

[![VillainWen](https://avatars.githubusercontent.com/u/70816393?v=4)](https://github.com/VillainWen "VillainWen (4 commits)")[![selina5262689](https://avatars.githubusercontent.com/u/18480962?v=4)](https://github.com/selina5262689 "selina5262689 (2 commits)")

---

Tags

phpcachesimple-cachepsr-16

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sabre/cache

Simple cache abstraction layer implementing PSR-16

541.2M3](/packages/sabre-cache)[voku/simple-cache

Simple Cache library

322.5M7](/packages/voku-simple-cache)

PHPackages © 2026

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