cache/psr-6-doctrine-bridge
Adapts any PSR-6 cache pool to Doctrine's legacy Cache interface. Install via Composer, then use contains, fetch, save and delete as usual; falls back to SHA-256 keys when the pool rejects a key. Includes getCachePool access.
Doctrine\Common\Cache\Cache while the underlying storage moves to a PSR-6 pool you already operate (Redis, Memcached). Frame the decision as "how long do we need the shim, and what replaces it," not "which cache library do we standardize on."FilesystemCache or APCu instance alongside a Redis layer, this collapses two systems into one, cutting one operational surface, one set of TTL configs, and one thing to monitor.Doctrine\Common\Cache\Cache. These are the only places the bridge earns its keep.Key PM caveat to surface in any decision doc: Doctrine\Common\Cache\Cache is deprecated and was removed in doctrine/cache 2.0; Doctrine ORM 3 uses PSR-6 natively. The bridge's useful lifespan is bounded by how long you stay on the legacy interface. Treat this as a dated bet with a scheduled exit, not a foundation.
Adopt when:
Doctrine\Common\Cache\Cache, and you want that traffic on a PSR-6 pool you already run in production.Look elsewhere when:
Cache interface, no problem this solves. Use Illuminate\Cache directly.doctrine/cache 2.x. The interface this bridges no longer exists. Adopting it would be adopting a solution to a problem you've already outgrown.Decision gate: before writing a line of code, answer two questions. (1) Which Doctrine version are we on, and when do we leave it? (2) Does anyone on the team own this if upstream goes quiet? If either answer is "don't know," don't adopt yet.
For executives — one paragraph, framed as risk reduction with a defined end date: "We have a small piece of technical debt: one part of our stack still uses Doctrine's deprecated caching interface while everything else has moved to a modern, standard cache layer. This package is a ~100-line MIT-licensed adapter that lets that legacy code use our existing cache infrastructure, so we can shut down a redundant cache system and stop paying to run and monitor two of them. It's low cost and low risk — the code is trivially replaceable if the project stalls — but it is explicitly a bridge, not a destination. I'd recommend approving it as a time-boxed migration with a target date to remove it once we finish the Doctrine upgrade."
For engineering and architecture:
DoctrineCacheBridge implementing Doctrine\Common\Cache\Cache on top of any Psr\Cache\CacheItemPoolInterface. No transitive dependencies, MIT, ~500 LOC.expiresAfter), and exception types may not map cleanly — we should test error paths, not just happy paths.Doctrine\Common\Cache\Cache and removed it in doctrine/cache 2.0. This package solves a problem that is actively disappearing. Recommendation: adopt as a migration accelerant with a documented removal ticket, and do not let it become a permanent layer. If we're already on Doctrine ORM 3, skip it entirely.For developers:
"Wrap your PSR-6 pool in DoctrineCacheBridge and hand it to Doctrine — that's the whole integration. Good for unblocking a legacy upgrade or getting Doctrine onto Redis without a refactor. Don't reach for it for new code, and don't expect tags or advanced invalidation. Verify it against our Doctrine version first; the README doesn't tell us what's supported."
How can I help you explore Laravel packages today?