cache / psr-6-doctrine-bridge
PSR-6 Doctrine bridge
4.0.4
2026-08-20 02:14 UTC
Requires
- php: ^8.2
- doctrine/cache: ^2.2
- psr/cache: ^3.0
- psr/cache-implementation: ^3.0
Requires (Dev)
- cache/array-adapter: ^3.0
- cache/chain-adapter: ^2.1
- cache/doctrine-adapter: ^3.0
- cache/filesystem-adapter: ^3.0
- league/flysystem: ^3.15.1
- league/flysystem-local: ^3.15
- mockery/mockery: ^1.6
- phpunit/phpunit: ^11.5
README
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.