class ConfigCache implements ConfigCacheInterface

ConfigCache manages PHP cache files.

When debug is enabled, it knows when to flush the cache thanks to an array of ResourceInterface instances.

Methods

__construct(string $file, bool $debug)

No description

string
__toString() deprecated

Gets the cache file path.

string
getPath()

Gets the cache file path.

bool
isFresh()

Checks if the cache is still fresh.

write(string $content, array $metadata = null)

Writes cache.

Details

at line line 35
__construct(string $file, bool $debug)

Parameters

string $file The absolute cache path
bool $debug Whether debugging is enabled or not

at line line 48
string __toString() deprecated

deprecated since 2.7, to be removed in 3.0. Use getPath() instead.

Gets the cache file path.

Return Value

string The cache file path

at line line 60
string getPath()

Gets the cache file path.

Return Value

string The cache file path

at line line 73
bool isFresh()

Checks if the cache is still fresh.

This method always returns true when debug is off and the cache file exists.

Return Value

bool Whether the cache is still fresh

at line line 132
write(string $content, array $metadata = null)

Writes cache.

Parameters

string $content The content to write into the cache
array $metadata An array of ResourceInterface instances

Exceptions

RuntimeException When cache file can't be written