class CacheFactory extends CacheFactory (View source)

This cache factory takes care of instantiating a cache frontend and injecting a certain cache backend. In a Flow context you should use the CacheManager to get a Cache.

Traits

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

Properties

protected EnvironmentConfiguration $environmentConfiguration
protected ApplicationContext $context

The current Flow context ("Production", "Development" etc.)

protected Environment $environment

Methods

instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration, bool $persistent = false)

No description

__construct(ApplicationContext $context, Environment $environment, string $applicationIdentifier)

Constructs this cache factory

create(string $cacheIdentifier, string $cacheObjectName, string $backendObjectName, array $backendOptions = [], bool $persistent = false)

No description

instantiateCache(string $cacheIdentifier, string $cacheObjectName, BackendInterface $backend)

No description

void
injectEnvironmentConfiguration(EnvironmentConfiguration $environmentConfiguration)

No description

Details

protected BackendInterface instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration, bool $persistent = false)

No description

Parameters

string $backendObjectName
array $backendOptions
EnvironmentConfiguration $environmentConfiguration
bool $persistent

Return Value

BackendInterface

Exceptions

InvalidBackendException

__construct(ApplicationContext $context, Environment $environment, string $applicationIdentifier)

Constructs this cache factory

Parameters

ApplicationContext $context

The current Flow context

Environment $environment
string $applicationIdentifier

FrontendInterface create(string $cacheIdentifier, string $cacheObjectName, string $backendObjectName, array $backendOptions = [], bool $persistent = false)

No description

Parameters

string $cacheIdentifier

The name / identifier of the cache to create

string $cacheObjectName

Object name of the cache frontend

string $backendObjectName

Object name of the cache backend

array $backendOptions

(optional) Array of backend options

bool $persistent

Return Value

FrontendInterface

The created cache frontend

protected FrontendInterface instantiateCache(string $cacheIdentifier, string $cacheObjectName, BackendInterface $backend)

No description

Parameters

string $cacheIdentifier
string $cacheObjectName
BackendInterface $backend

Return Value

FrontendInterface

Exceptions

InvalidCacheException

void injectEnvironmentConfiguration(EnvironmentConfiguration $environmentConfiguration)

No description

Parameters

EnvironmentConfiguration $environmentConfiguration

Return Value

void