Cache
in package
Table of Contents
- $cache : array<string, mixed>
- The cached data.
- $path : void
- The filesystem location of the cache file.
- get() : mixed
- Retrieves a single entry from the cache.
- getSize() : int
- Retrieves the number of cache entries.
- load() : void
- Loads existing cache data for the run, if any.
- save() : void
- Saves the current cache to the filesystem.
- set() : void
- Retrieves a single entry from the cache.
Properties
$cache
The cached data.
private
static array<string, mixed>
$cache
= []
$path
The filesystem location of the cache file.
private
static void
$path
= ''
Methods
get()
Retrieves a single entry from the cache.
public
static get([string $key = null ]) : mixed
Parameters
- $key : string = null
-
The key of the data to get. If NULL, everything in the cache is returned.
Return values
mixed —getSize()
Retrieves the number of cache entries.
public
static getSize() : int
Return values
int —load()
Loads existing cache data for the run, if any.
public
static load(Ruleset $ruleset, Config $config) : void
Parameters
Return values
void —save()
Saves the current cache to the filesystem.
public
static save() : void
Return values
void —set()
Retrieves a single entry from the cache.
public
static set(string $key, mixed $value) : void
Parameters
- $key : string
-
The key of the data to set. If NULL, sets the entire cache.
- $value : mixed
-
The value to set.