class SimpleCacheFactory (View source)

A factory for PSR-16 simple caches.

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

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

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

CacheInterface
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

CacheInterface 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

CacheInterface

Exceptions

InvalidBackendException

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

No description

Parameters

string $cacheIdentifier
BackendInterface $backend

Return Value

CacheInterface