FileCache
in package
implements
CacheInterface
File cache.
Caches feature into a file.
Tags
Table of Contents
Interfaces
- CacheInterface
- Parser cache interface.
Properties
- $path : mixed
Methods
- __construct() : mixed
- Initializes file cache.
- isFresh() : bool
- Checks that cache for feature exists and is fresh.
- read() : FeatureNode
- Reads feature cache from path.
- write() : mixed
- Caches feature node.
- getCachePathFor() : string
- Returns feature cache file path from features path.
Properties
$path
private
mixed
$path
Methods
__construct()
Initializes file cache.
public
__construct(string $path) : mixed
Parameters
- $path : string
-
Path to the folder where to store caches.
Tags
isFresh()
Checks that cache for feature exists and is fresh.
public
isFresh(string $path, int $timestamp) : bool
Parameters
- $path : string
-
Feature path
- $timestamp : int
-
The last time feature was updated
Return values
boolread()
Reads feature cache from path.
public
read(string $path) : FeatureNode
Parameters
- $path : string
-
Feature path
Tags
Return values
FeatureNodewrite()
Caches feature node.
public
write(string $path, FeatureNode $feature) : mixed
Parameters
- $path : string
-
Feature path
- $feature : FeatureNode
-
Feature instance
getCachePathFor()
Returns feature cache file path from features path.
protected
getCachePathFor(string $path) : string
Parameters
- $path : string
-
Feature path