PHPackages                             battis/simplecache - 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. battis/simplecache

AbandonedArchivedLibrary[Caching](/categories/caching)

battis/simplecache
==================

Manage a simple cache backed by a MySQL database

v1.2.2(10y ago)0239[2 issues](https://github.com/battis/simplecache/issues)5LGPL-3.0PHP

Since Aug 1Pushed 4y ago2 watchersCompare

[ Source](https://github.com/battis/simplecache)[ Packagist](https://packagist.org/packages/battis/simplecache)[ RSS](/packages/battis-simplecache/feed)WikiDiscussions main Synced today

READMEChangelog (4)DependenciesVersions (8)Used By (5)

SimpleCache
===========

[](#simplecache)

[![Latest Version](https://camo.githubusercontent.com/d69a50168caf5bc7a38e38b7915be10a0d395ca8ca6938b6c9516d171bd3d682/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261747469732f73696d706c6563616368652e737667)](https://packagist.org/packages/battis/simplecache)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cc7fe3b2674f8d83b631cdb42a6d0d2719279b11518295cad45e7e7411cbd6f2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6261747469732f73696d706c6563616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/battis/simplecache/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/211c98339abd8eaec78e61bc944bcfdc7f6d22e52a085555cd831d13b6165179/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6261747469732f73696d706c6563616368652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/battis/simplecache/?branch=master)[![Build Status](https://camo.githubusercontent.com/535916a06e7de24d94ae2524e16eff4a429caca5e6624e458ac28772ebe3dcc2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6261747469732f73696d706c6563616368652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/battis/simplecache/build-status/master)

Manage a simple cache backed by a MySQL database

Install
-------

[](#install)

In your `composer.json` add:

```
"require": {
  "battis/simplecache": "1.*"
}
```

Use
---

[](#use)

Create a cache:

```
$mysqli = new mysqli('localhost', 'bob', 's00pers3kr3t', 'app-db'); // or whatever your credentials are
$cache = new \Battis\SimpleCache($mysqli);
```

Basic workflow using cached data (check the cache and used cached data if there, otherwise build data and cache it for next time):

```
$data = $cache->getCache('foo');
if ($data === false) {

  // ... lots and lots of work to create $data from scratch

  $cache->setCache('foo', $data); // cache for next use
}
```

Full API documentation is available in [/docs](https://battis.github.io/simplecache/namespaces/Battis.html).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Total

6

Last Release

3851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0554a28104c65004c6de4d335ada25cf2763c8a9691dc5611314486d461fa4c?d=identicon)[battis](/maintainers/battis)

---

Top Contributors

[![battis](https://avatars.githubusercontent.com/u/419619?v=4)](https://github.com/battis "battis (18 commits)")

### Embed Badge

![Health badge](/badges/battis-simplecache/health.svg)

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

###  Alternatives

[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

33136.2k](/packages/beryllium-cachebundle)

PHPackages © 2026

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