cache/psr-6-doctrine-bridge

PSR-6 Doctrine bridge

Maintainers

Package info

github.com/php-cache/doctrine-bridge

Homepage

pkg:composer/cache/psr-6-doctrine-bridge

Transparency log

Statistics

Installs: 1 055 141

Dependents: 7

Suggesters: 0

Stars: 15

4.0.4 2026-08-20 02:14 UTC

This package is auto-updated.

Last update: 2026-08-20 02:28:43 UTC


README

Latest Stable Version Coverage Software License

This package adapts a PSR-6 cache pool to the legacy Doctrine\Common\Cache\Cache API.

Installation

composer require cache/psr-6-doctrine-bridge:^4.0

Usage

use Cache\Bridge\Doctrine\DoctrineCacheBridge;

$cacheProvider = new DoctrineCacheBridge($pool);

$cacheProvider->contains($key);
$cacheProvider->fetch($key);
$cacheProvider->save($key, $value, $ttl);
$cacheProvider->delete($key);

$cacheProvider->getCachePool();

$pool must implement Psr\Cache\CacheItemPoolInterface from psr/cache 3.x.

The bridge keeps legacy normalized keys when the pool accepts them. If the pool rejects a key, the bridge retries with a 64-character SHA-256 key.

Contributing

Send pull requests to the main repository. Report issues on the GitHub issue tracker.