PHPackages                             mrcnpdlk/psr16cache-adapter - 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. mrcnpdlk/psr16cache-adapter

ActiveLibrary[Caching](/categories/caching)

mrcnpdlk/psr16cache-adapter
===========================

Cache adapter for PSR-16

0.2.1(2y ago)141.2k—8.1%16MITPHPPHP &gt;=7.2

Since Oct 16Pushed 2y agoCompare

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

READMEChangelog (4)Dependencies (5)Versions (6)Used By (6)

[![Latest Stable Version](https://camo.githubusercontent.com/48ef45f98a05b3a9a2ccf1b4a2f684d452107be9134e6db712a8c0e2279b52f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d72636e70646c6b2f707372313663616368652d616461707465722e737667)](https://packagist.org/packages/mrcnpdlk/psr16cache-adapter)[![Latest Unstable Version](https://camo.githubusercontent.com/beae5d0acfc1efc877b749dfe48dbe2f6baa7e73d0fdf5c5045881c16e1cda0f/68747470733a2f2f706f7365722e707567782e6f72672f6d72636e70646c6b2f707372313663616368652d616461707465722f762f756e737461626c652e706e67)](https://packagist.org/packages/mrcnpdlk/psr16cache-adapter)[![Total Downloads](https://camo.githubusercontent.com/37a3f9ba6b026fb5cfe41aa96e8baa4da27141166167d782fa722d855e451534/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d72636e70646c6b2f707372313663616368652d616461707465722e737667)](https://packagist.org/packages/mrcnpdlk/psr16cache-adapter)[![Monthly Downloads](https://camo.githubusercontent.com/dd7dda244338ab9a77ab7c6280e8e390cf65dfc3f712874cb93df4c4db2eb382/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d72636e70646c6b2f707372313663616368652d616461707465722e737667)](https://packagist.org/packages/mrcnpdlk/psr16cache-adapter)[![License](https://camo.githubusercontent.com/569e54becf6f33a64a3baf2034fadaee201924113f60819d7098affb871421c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d72636e70646c6b2f707372313663616368652d616461707465722e737667)](https://packagist.org/packages/mrcnpdlk/psr16cache-adapter)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1192a3cfb12d84e89b78a89651176271b27862be147eb099f3727e059550a3bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f707372313663616368652d616461707465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/psr16cache-adapter/?branch=master)[![Build Status](https://camo.githubusercontent.com/81deb60d4db922fa4dbaf021273e02e1a50cb5c778f406e12b45285f5da0e32a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f707372313663616368652d616461707465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/psr16cache-adapter/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/1890271f965f3288725b274946b81a876c6ff4dac58f77f93033212e96dd5a25/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f707372313663616368652d616461707465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/psr16cache-adapter/?branch=master)

[![Code Climate](https://camo.githubusercontent.com/d800da1a0bed8654117c40f234809154ad6d7b6f7ff6fa87c4979d45f438ceb7/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f707372313663616368652d616461707465722f6261646765732f6770612e737667)](https://codeclimate.com/github/mrcnpdlk/psr16cache-adapter)[![Issue Count](https://camo.githubusercontent.com/b8aac8b7b96b0beb1a8aca06205254c3f51fc5cf110eb5f3b73497efc4fbacf4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f707372313663616368652d616461707465722f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/mrcnpdlk/psr16cache-adapter)

PSR-16 Cache Adapter
====================

[](#psr-16-cache-adapter)

Instalation
-----------

[](#instalation)

```
composer require mrcnpdlk/psr16cache-adapter
```

Basic usage
-----------

[](#basic-usage)

```
$oInstanceCacheFile = new \phpFastCache\Helper\Psr16Adapter(
    'files',
    [
        "host"                => null, // default localhost
        "port"                => null, // default 6379
        'defaultTtl'          => 3600 * 24, // 24h
        'ignoreSymfonyNotice' => true,
    ]);
$oInstanceLogger    = new \Monolog\Logger('name_of_my_logger');
$oInstanceLogger->pushHandler(new \Monolog\Handler\ErrorLogHandler(
        \Monolog\Handler\ErrorLogHandler::OPERATING_SYSTEM,
        \Psr\Log\LogLevel::DEBUG
    )
);

$oCacheAdapter = new \mrcnpdlk\Psr16Cache\Adapter($oInstanceCacheFile, $oInstanceLogger);
$oCacheAdapter->setHashSalt(['some_hash', __DIR__]);

$res = $oCacheAdapter->useCache(
    function () {
        return '1';
    },
    ['key1', 'key2'],
    10
);

var_dump($res);
```

Response

```
[2017-10-16 19:17:41] name_of_my_logger.DEBUG: CACHE [ffe7efd40ef900c95726a859aa28e048]: old, reset [] []
string(1) "1"

[2017-10-16 19:17:44] name_of_my_logger.DEBUG: CACHE [ffe7efd40ef900c95726a859aa28e048]: getting from cache [] []
string(1) "1"

```

Running the tests
-----------------

[](#running-the-tests)

```
./vendor/bin/phpunit
```

Authors
-------

[](#authors)

- **Marcin Pudełek** - *Initial work* - [mrcnpdlk](https://github.com/mrcnpdlk)

See also the list of [contributors](https://github.com/mrcnpdlk/validator/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/mrcnpdlk/psr16cache-adapter/blob/master/LICENSE) file for details

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

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

Total

4

Last Release

847d ago

### Community

Maintainers

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

---

Top Contributors

[![mrcnpdlk](https://avatars.githubusercontent.com/u/22945316?v=4)](https://github.com/mrcnpdlk "mrcnpdlk (9 commits)")

---

Tags

cachepsr16

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mrcnpdlk-psr16cache-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/mrcnpdlk-psr16cache-adapter/health.svg)](https://phpackages.com/packages/mrcnpdlk-psr16cache-adapter)
```

###  Alternatives

[cache/adapter-common

Common classes for PSR-6 adapters

11124.4M38](/packages/cache-adapter-common)[cache/cache

Library of all the php-cache adapters

2712.7M22](/packages/cache-cache)[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[graham-campbell/bounded-cache

A Bounded TTL PSR-16 Cache Implementation

101.9M6](/packages/graham-campbell-bounded-cache)[mmamedov/page-cache

PageCache is a lightweight PHP library for full page cache. It uses various strategies to differentiate among separate versions of the same page.

7912.7k1](/packages/mmamedov-page-cache)[chillerlan/php-cache

A psr/simple-cache implementation. PHP 8.1+

15211.8k11](/packages/chillerlan-php-cache)

PHPackages © 2026

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