roave / doctrine-simplecache
Doctrine Cache adapter for PSR-16 Simple Cache
Installs: 1 312 902
Dependents: 2
Suggesters: 0
Security: 0
Stars: 55
Watchers: 9
Forks: 11
Open Issues: 10
pkg:composer/roave/doctrine-simplecache
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
 - doctrine/cache: ^1.13.0
 - psr/simple-cache: ^1.0.1
 
Requires (Dev)
- cache/integration-tests: dev-master
 - cache/tag-interop: dev-master
 - infection/infection: ^0.26.19
 - phpunit/phpunit: ^9.6.7
 
Provides
- 2.9.x-dev
 - 2.8.x-dev
 - 2.8.0
 - 2.7.x-dev
 - 2.7.0
 - 2.6.x-dev
 - 2.6.0
 - 2.5.x-dev
 - 2.5.0
 - 2.4.x-dev
 - 2.4.0
 - 2.3.x-dev
 - 2.3.0
 - 2.2.0
 - 2.1.1
 - 2.1.0
 - 2.0.0
 - 1.1.0
 - 1.0.1
 - 1.0.0
 - dev-renovate/phpunit-phpunit-12.x
 - dev-renovate/all-minor-patch
 - dev-renovate/actions-checkout-5.x
 - dev-renovate/lock-file-maintenance
 - dev-renovate/psr-simple-cache-3.x
 - dev-renovate/doctrine-cache-2.x
 - dev-php81-support
 
This package is auto-updated.
Last update: 2025-10-30 10:44:50 UTC
README
PSR-16 SimpleCache implementation that accepts a Doctrine Cache and adapts it for the PSR-16 standards.
Installation
This will install doctrine/cache if not already installed.
$ composer require roave/doctrine-simplecache
Usage
Create your Doctrine Cache the usual way and inject it into SimpleCacheAdapter, for example:
<?php namespace App; use Psr\Container\ContainerInterface; use Psr\SimpleCache\CacheInterface as PsrCacheInterface; use Roave\DoctrineSimpleCache\SimpleCacheAdapter; use Doctrine\Common\Cache\RedisCache; final class MyCacheFactory { public function __invoke(ContainerInterface $container) : PsrCacheInterface { return new SimpleCacheAdapter(new RedisCache()); } }
Upgrade Guide
BC Breaks in 2.0
- Support for 
MultiOperationCacheadded, includes support fordeleteMultiplein Doctrine 1.7 breaks:CacheExceptionstatic constructorsfromNonMultiGetCacheandfromNonMultiPutCachehave been replaced withfromNonMultiOperationCache.SimpleCacheAdapternow requires an adapter implementingMultiOperationCache, and no longer specifically requires a cache implementingMultiGetCacheorMultiPutCacheexplicitly.