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

ActiveLibrary[Caching](/categories/caching)

snakano/cache-store
===================

provides a generic way to cache any data

1.5.0(10y ago)954.6k↑31.9%61MITPHPPHP &gt;=5.3.3

Since May 18Pushed 10y ago2 watchersCompare

[ Source](https://github.com/SNakano/CacheStore)[ Packagist](https://packagist.org/packages/snakano/cache-store)[ RSS](/packages/snakano-cache-store/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (14)Used By (1)

DominoCacheStore
================

[](#dominocachestore)

[![Build Status](https://camo.githubusercontent.com/f1a6e73ef21e922d1a35a096f5ed7b9b1fbda9e35d0e1bf2896ad1a93ba2de2d/68747470733a2f2f7472617669732d63692e6f72672f534e616b616e6f2f436163686553746f72652e706e67)](https://travis-ci.org/SNakano/CacheStore)[![Latest Stable Version](https://camo.githubusercontent.com/c61159f0c6f7f18d424df44b87cef9fb769ab3f2017dac5b320530eb21c3cf61/68747470733a2f2f706f7365722e707567782e6f72672f736e616b616e6f2f63616368652d73746f72652f762f737461626c652e737667)](https://packagist.org/packages/snakano/cache-store)[![Total Downloads](https://camo.githubusercontent.com/6c3e0bdc026ff2429e62fbcfc96a48609d6b7a709460a829fdc91cad0e7ec9ea/68747470733a2f2f706f7365722e707567782e6f72672f736e616b616e6f2f63616368652d73746f72652f646f776e6c6f6164732e737667)](https://packagist.org/packages/snakano/cache-store)[![License](https://camo.githubusercontent.com/e9f1087d6cbaa96026c3b9d64d6d43b100efb613c58f8bab8c6a2ace468f499f/68747470733a2f2f706f7365722e707567782e6f72672f736e616b616e6f2f63616368652d73746f72652f6c6963656e73652e737667)](https://packagist.org/packages/snakano/cache-store)

provides a generic way to cache any data.

- It provide common interface for cache library.
- support cache library APC, memcached and Redis.
- support namespace. (use namespace delete)

Install
-------

[](#install)

using Composer(recommended):

```
{
    "require": {
        "snakano/cache-store": "1.*"
    }
}
```

or cloning this repository.

Usage
-----

[](#usage)

```
// configure cache setting.
Domino\CacheStore\Factory::setOptions(
    array(
        array(
            'storage'     => 'apc'
            'default_ttl' => 360
        ),
        array(
            'storage'     => 'memcached',
            'prefix'      => 'domino_test',
            'default_ttl' => 360,
            'servers'     => array(
                array('server1', 11211, 20),
                array('server2', 11211, 80)
            )
        ),
        array(
            'storage'     => 'redis',
            'prefix'      => 'domino_test',
            'host'        => '127.0.0.1',
            'port'        => 6379,
            'default_ttl' => 360
        )
    )
);

// factory cache storage
$storage = Domino\CacheStore\Factory::factory('memcached');

// register custom cache storage
$storage = Domino\CacheStore\Factory::registerStorage('acme_storage', 'Acme\Storage\AcmeStorage');

// set data
$storage->set('ns1', 'key1', 'value1');
$storage->set('ns1', 'key2', 'value2');
$storage->set('ns2', 'key1', 'value1');
$storage->set('ns2', 'key2', 'value2', 10); // specify ttl

// get data
$storage->get('ns1', 'key1');
# => 'value1'

// delete by namespace and key
$storage->clear("ns1", 'key1');
$storage->get('ns1', 'key1');
# => null

// delete by namespace
$storage->clearByNamespace('ns1');
$storage->get('ns1', 'key2');
# => null
$storage->get('ns2', 'key1');
# => 'value1'

// delete all
$storage->clearAll();
$storage->get('ns2', 'key1');
# => null

// disable caching at runtime
Domino\CacheStore\Factory::disableCaching();
// since caching is disabled, the factory will return an instance of "NoCache"
$storage = Domino\CacheStore\Factory::factory('memcached');

// enable caching at runtime
Domino\CacheStore\Factory::enableCaching();
// since caching is enabled again, the factory will return an instance of "Memcached"
$storage = Domino\CacheStore\Factory::factory('memcached');
```

License
-------

[](#license)

MIT license.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 70.5% 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 ~80 days

Recently: every ~157 days

Total

13

Last Release

3821d ago

### Community

Maintainers

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

---

Top Contributors

[![SNakano](https://avatars.githubusercontent.com/u/1312539?v=4)](https://github.com/SNakano "SNakano (31 commits)")[![stevleibelt](https://avatars.githubusercontent.com/u/2287220?v=4)](https://github.com/stevleibelt "stevleibelt (6 commits)")[![geopal-solutions](https://avatars.githubusercontent.com/u/3493628?v=4)](https://github.com/geopal-solutions "geopal-solutions (2 commits)")[![bizmate](https://avatars.githubusercontent.com/u/1427498?v=4)](https://github.com/bizmate "bizmate (2 commits)")[![gms8994](https://avatars.githubusercontent.com/u/50712?v=4)](https://github.com/gms8994 "gms8994 (1 commits)")[![aj0y](https://avatars.githubusercontent.com/u/1134055?v=4)](https://github.com/aj0y "aj0y (1 commits)")[![Shurikn](https://avatars.githubusercontent.com/u/7237650?v=4)](https://github.com/Shurikn "Shurikn (1 commits)")

---

Tags

apccachememcachedphpredisrediscachememcachedapc

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tedivm/stash

The place to keep your cache.

9614.9M128](/packages/tedivm-stash)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

871.4M16](/packages/tedivm-stash-bundle)[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M5](/packages/sabre-cache)[ihor/cachalot

Cache a lot in a proper way (APC, XCache, Memcached, Redis, Couchbase)

2528.4k](/packages/ihor-cachalot)[robinn/phpcacheadmin

A web dashboard for your favorite caching system.

4483.8k1](/packages/robinn-phpcacheadmin)[aplus/cache

Aplus Framework Cache Library

171.6M4](/packages/aplus-cache)

PHPackages © 2026

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