W3cubDocs

/Symfony 3.0

Symfony\Component\Config\ResourceCheckerConfigCache

class ResourceCheckerConfigCache implements ConfigCacheInterface

ResourceCheckerConfigCache uses instances of ResourceCheckerInterface to check whether cached data is still fresh.

Methods

__construct(string $file, array $resourceCheckers = array())
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

public __construct(string $file, array $resourceCheckers = array())

Parameters

string $file The absolute cache path
array $resourceCheckers The ResourceCheckers to use for the freshness check

public string getPath()

Gets the cache file path.

Return Value

string The cache file path

public bool isFresh()

Checks if the cache is still fresh.

This implementation will make a decision solely based on the ResourceCheckers passed in the constructor.

The first ResourceChecker that supports a given resource is considered authoritative. Resources with no matching ResourceChecker will silently be ignored and considered fresh.

Return Value

bool true if the cache is fresh, false otherwise

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

Writes cache.

Parameters

string $content The content to write in the cache
array $metadata An array of metadata

Exceptions

RuntimeException When cache file can't be written

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Config/ResourceCheckerConfigCache.html