class FileCacheFactory (View source)

Creates a FileCache object.

Constants

DISABLE_CACHE

The configuration key to disable FileCache completely.

Properties

static protected array $configuration

The configuration used to create FileCache objects.

static protected string $prefix

The cache prefix.

Methods

get(string $collection, array $default_configuration = [])

Instantiates a FileCache object for a given collection identifier.

static array
getConfiguration()

Gets the configuration used for constructing future file cache objects.

static 
setConfiguration(array $configuration)

Sets the configuration to use for constructing future file cache objects.

static string
getPrefix()

Returns the cache prefix.

static 
setPrefix(string $prefix)

Sets the cache prefix that should be used.

Details

static FileCacheInterface get(string $collection, array $default_configuration = [])

Instantiates a FileCache object for a given collection identifier.

Parameters

string $collection

The collection identifier for this FileCache.

array $default_configuration

(optional) The default configuration for this FileCache collection. This can be used to e.g. specify default usage of a FileCache class.

Return Value

FileCacheInterface

The initialized FileCache object.

static array getConfiguration()

Gets the configuration used for constructing future file cache objects.

Return Value

array

The configuration that is used.

static setConfiguration(array $configuration)

Sets the configuration to use for constructing future file cache objects.

Parameters

array $configuration

The configuration to use.

static string getPrefix()

Returns the cache prefix.

Return Value

string

The cache prefix.

static setPrefix(string $prefix)

Sets the cache prefix that should be used.

Should be set to a secure, unique key to prevent cache pollution by a third party.

Parameters

string $prefix

The cache prefix.