ConfigCache
extends ResourceCheckerConfigCache
in package
ConfigCache caches arbitrary content in files on disk.
When in debug mode, those metadata resources that implement \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will be used to check cache freshness.
Tags
Table of Contents
- $debug : mixed
- $file : string
- $resourceCheckers : iteratable<string|int, mixed>|array<string|int, ResourceCheckerInterface>
- __construct() : mixed
- getPath() : string
- Gets the cache file path.
- isFresh() : bool
- Checks if the cache is still fresh.
- write() : mixed
- Writes cache.
- getMetaFile() : string
- Gets the meta file path.
- safelyUnserialize() : mixed
Properties
$debug
private
mixed
$debug
$file
private
string
$file
$resourceCheckers
private
iteratable<string|int, mixed>|array<string|int, ResourceCheckerInterface>
$resourceCheckers
Methods
__construct()
public
__construct(string $file, bool $debug) : mixed
Parameters
- $file : string
-
The absolute cache path
- $debug : bool
-
Whether debugging is enabled or not
Return values
mixed —getPath()
Gets the cache file path.
public
getPath() : string
Return values
string —The cache file path
isFresh()
Checks if the cache is still fresh.
public
isFresh() : bool
This implementation always returns true when debug is off and the cache file exists.
Return values
bool —true if the cache is fresh, false otherwise
write()
Writes cache.
public
write(string $content[, array<string|int, ResourceInterface> $metadata = null ]) : mixed
Parameters
- $content : string
-
The content to write in the cache
- $metadata : array<string|int, ResourceInterface> = null
-
An array of metadata
Tags
Return values
mixed —getMetaFile()
Gets the meta file path.
private
getMetaFile() : string
Return values
string —safelyUnserialize()
private
safelyUnserialize(string $file) : mixed
Parameters
- $file : string