ApcuCacheFactory
class ApcuCacheFactory extends AbstractCacheFactory implements InMemoryCacheFactory (View source)
Factory to instantiate an ApcuAdapter for use in caching.
Note that APCu cache may not be shared between your webserver and the CLI. Flushing the cache from your terminal may not flush the cache used by the webserver. See https://github.com/symfony/symfony/discussions/54066
Properties
protected | LoggerInterface|null | $logger | from AbstractCacheFactory |
Methods
Creates an object with a PSR-16 interface, usually from a PSR-6 class name.
Prepare a cache adapter for use.
Instantiates a cache adapter, either via the dependency injector or using the new keyword.
Create a PSR6-compliant cache adapter
Details
__construct(LoggerInterface|null $logger = null)
No description
protected CacheInterface
createCache(string $class, array $args, bool $useInjector = true)
Creates an object with a PSR-16 interface, usually from a PSR-6 class name.
Quick explanation of caching standards:
- Symfony cache implements the PSR-6 standard
- Symfony provides adapters which wrap a PSR-6 backend with a PSR-16 interface
- Silverstripe uses the PSR-16 interface to interact with caches. It does not directly interact with the PSR-6 classes
- Psr\SimpleCache\CacheInterface is the php interface of the PSR-16 standard. All concrete cache classes Silverstripe code interacts with should implement this interface
Further reading:
protected CacheInterface
prepareCacheForUse(CacheInterface $cacheAdapter, bool $useInjector)
Prepare a cache adapter for use.
This wraps a PSR6 adapter inside a PSR16 one. It also adds the loggers.
protected CacheInterface
instantiateCache(string $class, array $args, bool $useInjector)
Instantiates a cache adapter, either via the dependency injector or using the new keyword.
protected bool
addLogger(CacheInterface $cache)
No description
object|null
create(string $service, array $params = [])
No description
CacheItemPoolInterface
createPsr6(string $service, array $params = [])
Create a PSR6-compliant cache adapter