ResourceCheckerConfigCacheFactory
in package
implements
ConfigCacheFactoryInterface
A ConfigCacheFactory implementation that validates the cache with an arbitrary set of ResourceCheckers.
Tags
Table of Contents
Interfaces
- ConfigCacheFactoryInterface
- Interface for a ConfigCache factory. This factory creates an instance of ConfigCacheInterface and initializes the cache if necessary.
Properties
- $resourceCheckers : iterable<string|int, mixed>
Methods
- __construct() : mixed
- cache() : ConfigCacheInterface
- Creates a cache instance and (re-)initializes it if necessary.
Properties
$resourceCheckers
private
iterable<string|int, mixed>
$resourceCheckers
= []
Methods
__construct()
public
__construct([iterable<int, ResourceCheckerInterface> $resourceCheckers = [] ]) : mixed
Parameters
- $resourceCheckers : iterable<int, ResourceCheckerInterface> = []
cache()
Creates a cache instance and (re-)initializes it if necessary.
public
cache(string $file, callable $callable) : ConfigCacheInterface
Parameters
- $file : string
-
The absolute cache file path
- $callable : callable
-
The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback