W3cubDocs

/Symfony 4.1

AbstractPhpFileCacheWarmer

abstract class AbstractPhpFileCacheWarmer implements CacheWarmerInterface

Methods

__construct(string $phpArrayFile, CacheItemPoolInterface $fallbackPool)
bool isOptional()

Checks whether this warmer is optional or not.

warmUp(string $cacheDir)

Warms up the cache.

warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values)
bool doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)

Details

__construct(string $phpArrayFile, CacheItemPoolInterface $fallbackPool)

Parameters

string $phpArrayFile The PHP file where metadata are cached
CacheItemPoolInterface $fallbackPool The pool where runtime-discovered metadata are cached

bool isOptional()

Checks whether this warmer is optional or not.

Optional warmers can be ignored on certain conditions.

A warmer should return true if the cache can be generated incrementally and on-demand.

Return Value

bool true if the warmer is optional, false otherwise

warmUp(string $cacheDir)

Warms up the cache.

Parameters

string $cacheDir The cache directory

protected warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values)

Parameters

PhpArrayAdapter $phpArrayAdapter
array $values

abstract protected bool doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)

Parameters

string $cacheDir
ArrayAdapter $arrayAdapter

Return Value

bool false if there is nothing to warm-up