Skip to content

Repository files navigation

Doctrine SimpleCache adapter

Build StatusScrutinizer Code QualityCode CoverageLatest Stable VersionLicense

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:

<?phpnamespaceApp;
usePsr\Container\ContainerInterface;
usePsr\SimpleCache\CacheInterfaceasPsrCacheInterface;
useRoave\DoctrineSimpleCache\SimpleCacheAdapter;
useDoctrine\Common\Cache\RedisCache;
finalclass MyCacheFactory
{
publicfunction__invoke(ContainerInterface$container) : PsrCacheInterface
{
returnnewSimpleCacheAdapter(newRedisCache());
}
}

Upgrade Guide

BC Breaks in 2.0

  • Support for MultiOperationCache added, includes support for deleteMultiple in Doctrine 1.7 breaks:
    • CacheException static constructors fromNonMultiGetCache and fromNonMultiPutCache have been replaced with fromNonMultiOperationCache.
    • SimpleCacheAdapter now requires an adapter implementing MultiOperationCache, and no longer specifically requires a cache implementing MultiGetCache or MultiPutCache explicitly.

About

Doctrine Cache adapter for PSR-16 Simple Cache

Resources

Stars

55 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages