cache / psr-6-doctrine-bridge
PSR-6 Doctrine bridge
3.2.0
2022-01-15 15:47 UTC
Requires
- php: >=7.4
- doctrine/cache: ^1.6
- psr/cache-implementation: ^1.0
Requires (Dev)
- cache/doctrine-adapter: ^1.0
- mockery/mockery: ^1.0
- phpunit/phpunit: ^7.5.20 || ^9.5.10
README
This library provides a PSR-6 compliant bridge between Doctrine and a Cache Pool. The bridge implements the
Doctrine\Common\Cache\Cache
interface. This is useful for projects that require an implementation of
Doctrine\Common\Cache\Cache
, but you still want to use a PSR-6 implementation.
Install
composer require cache/psr-6-doctrine-bridge
Usage
use Cache\Bridge\Doctrine\DoctrineCacheBridge; // Assuming $pool is an instance of \Psr\Cache\CacheItemPoolInterface $cacheProvider = new DoctrineCacheBridge($pool); $cacheProvider->contains($key); $cacheProvider->fetch($key); $cacheProvider->save($key, $value, $ttl); $cacheProvider->delete($key); // Also, if you need it: $cacheProvider->getPool(); // same as $pool
Contribute
Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.