class NullFileCache implements FileCacheInterface (View source)

Null implementation for the file cache.

Methods

__construct(string $prefix, string $collection, string|null $cache_backend_class = NULL, array $cache_backend_configuration = [])

Constructs a FileCache object.

mixed|null
get(string $filepath)

Gets data based on a filename.

array
getMultiple(array $filepaths)

Gets data based on filenames.

set(string $filepath, mixed $data)

Stores data based on a filename.

delete(string $filepath)

Deletes data from the cache.

Details

__construct(string $prefix, string $collection, string|null $cache_backend_class = NULL, array $cache_backend_configuration = [])

Constructs a FileCache object.

Parameters

string $prefix

A prefix that is used as a prefix, should be set to a secure, unique key to prevent cache pollution by a third party.

string $collection

A collection identifier to ensure that the same files could be cached for different purposes without clashing.

string|null $cache_backend_class

(optional) The class that should be used as cache backend.

array $cache_backend_configuration

(optional) The configuration for the backend class.

mixed|null get(string $filepath)

Gets data based on a filename.

Parameters

string $filepath

Path of the file that the cached data is based on.

Return Value

mixed|null

The data that was persisted with set() or NULL if there is no data or the file has been modified.

array getMultiple(array $filepaths)

Gets data based on filenames.

Parameters

array $filepaths

List of file paths used as cache identifiers.

Return Value

array

List of cached data keyed by the passed in file paths.

set(string $filepath, mixed $data)

Stores data based on a filename.

Parameters

string $filepath

Path of the file that the cached data is based on.

mixed $data

The data that should be cached.

delete(string $filepath)

Deletes data from the cache.

Parameters

string $filepath

Path of the file that the cached data is based on.