MemoryCache
in package
implements
CacheInterface
Memory cache.
Caches feature into a memory.
Tags
Table of Contents
Interfaces
- CacheInterface
- Parser cache interface.
Properties
- $features : mixed
- $timestamps : mixed
Methods
- isFresh() : bool
- Checks that cache for feature exists and is fresh.
- read() : FeatureNode
- Reads feature cache from path.
- write() : mixed
- Caches feature node.
Properties
$features
private
mixed
$features
= array()
$timestamps
private
mixed
$timestamps
= array()
Methods
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
Return values
FeatureNodewrite()
Caches feature node.
public
write(string $path, FeatureNode $feature) : mixed
Parameters
- $path : string
-
Feature path
- $feature : FeatureNode
-
Feature instance