ConfigCache
in package
A config cache stores values using var_export() and include.
Tags
Table of Contents
- $dir : mixed
- __construct() : mixed
- Construct.
- get() : mixed
- Loads and returns the value for the supplied cache key.
- getTimestamp() : int
- Returns a timestamp for when the cache was created.
- has() : bool
- Checks of the cache has a file.
- set() : mixed
- Writes a value to a file.
- getSourcePath() : string
- Returns the path where the file corresponding to the supplied cache key can be included from.
Properties
$dir
private
mixed
$dir
Methods
__construct()
Construct.
public
__construct(string $dir) : mixed
Parameters
- $dir : string
-
The cache directory
Return values
mixed —get()
Loads and returns the value for the supplied cache key.
public
get(string $resource) : mixed
Parameters
- $resource : string
-
A cache key
Return values
mixed —The cached value
getTimestamp()
Returns a timestamp for when the cache was created.
public
getTimestamp(string $resource) : int
Parameters
- $resource : string
-
A cache key
Return values
int —A UNIX timestamp
has()
Checks of the cache has a file.
public
has(string $resource) : bool
Parameters
- $resource : string
-
A cache key
Return values
bool —True if a file exists
set()
Writes a value to a file.
public
set(string $resource, mixed $value) : mixed
Parameters
- $resource : string
-
A cache key
- $value : mixed
-
A value to cache
Return values
mixed —getSourcePath()
Returns the path where the file corresponding to the supplied cache key can be included from.
private
getSourcePath(string $resource) : string
Parameters
- $resource : string
-
A cache key
Return values
string —A file path