PHPackages                             bentools/redis-psr6-ttl-aware-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. bentools/redis-psr6-ttl-aware-adapter

ActiveLibrary

bentools/redis-psr6-ttl-aware-adapter
=====================================

Override of Symfony PSR6 cache RedisAdapter, retrieving expiration on an existing item.

v1.0.1(9y ago)0190MITPHP

Since Sep 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/redis-psr6-ttl-aware-adapter)[ Packagist](https://packagist.org/packages/bentools/redis-psr6-ttl-aware-adapter)[ RSS](/packages/bentools-redis-psr6-ttl-aware-adapter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Description
-----------

[](#description)

Override of Symfony PSR6 cache RedisAdapter, retrieving expiration on an existing item.

This allows, for instance, to increment a value into the cache until it expires. The original Symfony cache implementation actually resets the expiration delay after each save().

Example use :
-------------

[](#example-use-)

```
$redis = new Redis();
$redis->connect('127.0.0.1');
$cache = new \BenTools\Cache\Adapter\RedisTTLAwareAdapter($redis);

$key = 'my.example';

# Assume my.example does not exist
var_dump($cache->hasItem($key)); // false
$item = $cache->getItem($key);
$item->set(1);
$item->expiresAfter(5); // expires in 5 seconds
$cache->save($item);
sleep(2);

# After 2 seconds, my.example == 1
var_dump($cache->hasItem($key)); // true
$item = $cache->getItem($key);
$value = $item->get(); // 1
var_dump($value); // 1

$item->set($value + 1);
$cache->save($item);
sleep(2);

# After 4 seconds, my.example == 2
var_dump($cache->hasItem($key)); // true
$item = $cache->getItem($key);
$value = $item->get();
var_dump($value); // 2

$item->set($value + 1);
$cache->save($item);
sleep(2);

# After 6 seconds, my.example does not exist anymore
var_dump($cache->hasItem($key)); // false
$item = $cache->getItem($key);
$value = $item->get();
var_dump($value); // null
```

Installation
------------

[](#installation)

```
composer require bentools/redis-psr6-ttl-aware-adapter

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3540d ago

### Community

Maintainers

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

---

Top Contributors

[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (2 commits)")

### Embed Badge

![Health badge](/badges/bentools-redis-psr6-ttl-aware-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/bentools-redis-psr6-ttl-aware-adapter/health.svg)](https://phpackages.com/packages/bentools-redis-psr6-ttl-aware-adapter)
```

PHPackages © 2026

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