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

ActiveLibrary[Caching](/categories/caching)

dadapas/cache
=============

PSR-6 and PSR-16 Implementations

1.1.2(3y ago)15MITPHPPHP &gt;=7.2

Since Jun 13Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

### PHP Cache

[](#php-cache)

This is an implementation of PSR-6 and PSR-16 cache interface,

Installation
============

[](#installation)

Install composer if not and enter the command

```
composer require dadapas/cache
```

Basic usage
===========

[](#basic-usage)

A basic usage of cache

```
use Dadapas\Cache\CacheItemPool;
use Dadapas\Cache\CacheItem;
use Dadapas\Cache\FileCacheAdapter;

// Declarations
$adapter   = new FileCacheAdapter(__DIR__."/cache"); // cache adapter
$pool      = new CacheItemPool($adapter);            // pool

$key       = "mykey";
$cacheItem = new CacheItem($key);                    // cache item
// Set the cache value
$cacheItem->set("cache value");
$cacheItem->expiresAfter(3600);                      // cache will live in 1 hour
$pool->save($cache);                                 // Save the cache

// ...
```

To get a cache from the pool

```
// Get cache by key null if key not exist
$cacheItem = $pool->getItem($key);

// get the cache value null if expires or non exist key
$cacheItem->get();

// To get the key
$cacheItem->getKey();

// Set the exact expiration date
// This data will expire in 1st january 2023
$cacheItem->expiresAt(new DateTime("2023-01-01"));

//
```

You can then pick one of the implementations of the interface to get a logger.

If you want to implement the interface, you can require this package and implement `Psr\Cache\CacheItemPoolInterface` in the code code. Please read the [specification text](https://packagist.org/packages/psr/log)for details.

Test
====

[](#test)

For making a test just

```
composer test
```

License
=======

[](#license)

The licence is MIT for more details click [here](LICENSE)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

1435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/456979997044b4a0b274d30db252afec25d17cfe5fcdda66d75460562e4fa0f6?d=identicon)[Dadapas](/maintainers/Dadapas)

---

Top Contributors

[![Dadapas](https://avatars.githubusercontent.com/u/9548602?v=4)](https://github.com/Dadapas "Dadapas (24 commits)")

---

Tags

cachepsrpsr-16psr-6

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k348.9M2.5k](/packages/symfony-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)[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)[cache/filesystem-adapter

A PSR-6 cache implementation using filesystem. This implementation supports tags

705.8M82](/packages/cache-filesystem-adapter)[cache/array-adapter

A PSR-6 cache implementation using a php array. This implementation supports tags

548.3M151](/packages/cache-array-adapter)

PHPackages © 2026

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