class CacheFactory (View source)

A factory for the PSR-6 compatible cache pool.

Traits

Abstracts the task of creating a BackendInterface implementation with it's options.

Properties

protected EnvironmentConfiguration $environmentConfiguration

Methods

instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration)

No description

__construct(EnvironmentConfiguration $environmentConfiguration)

Constructs this cache factory

CacheItemPoolInterface
create(string $cacheIdentifier, string $backendObjectName, array $backendOptions = [])

Factory method which creates the specified cache along with the specified kind of backend.

CacheItemPoolInterface
instantiateCache(string $cacheIdentifier, BackendInterface $backend)

No description

Details

protected BackendInterface instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration)

No description

Parameters

string $backendObjectName
array $backendOptions
EnvironmentConfiguration $environmentConfiguration

Return Value

BackendInterface

Exceptions

InvalidBackendException

__construct(EnvironmentConfiguration $environmentConfiguration)

Constructs this cache factory

Parameters

EnvironmentConfiguration $environmentConfiguration

CacheItemPoolInterface create(string $cacheIdentifier, string $backendObjectName, array $backendOptions = [])

Factory method which creates the specified cache along with the specified kind of backend.

The identifier uniquely identifiers the specific cache, so that entries inside are unique.

Parameters

string $cacheIdentifier

The name / identifier of the cache to create.

string $backendObjectName

Object name of the cache backend

array $backendOptions

(optional) Array of backend options

Return Value

CacheItemPoolInterface

Exceptions

InvalidBackendException

protected CacheItemPoolInterface instantiateCache(string $cacheIdentifier, BackendInterface $backend)

No description

Parameters

string $cacheIdentifier
BackendInterface $backend

Return Value

CacheItemPoolInterface