ApcCache
in package
implements
CacheInterface
The default implementation that is passed in the Api object when created: it is based on APCU, and therefore requires APCU to be installed on the server.
Interfaces, Classes, Traits and Enums
- CacheInterface
- This is the interface you're supposed to implement if you want to use your own caching strategy with the kit.
Table of Contents
- clear() : void
- Clears the whole cache
- delete() : void
- Deletes a cache entry, from its key
- get() : mixed
- Returns the value of a cache entry from its key
- has() : bool
- Tests whether the cache has a value for a particular key
- set() : void
- Stores a new cache entry
Methods
clear()
Clears the whole cache
public
clear() : void
Return values
void —delete()
Deletes a cache entry, from its key
public
delete(string $key) : void
Parameters
- $key : string
-
the key of the cache entry
Return values
void —get()
Returns the value of a cache entry from its key
public
get(string $key) : mixed
Parameters
- $key : string
-
the key of the cache entry
Return values
mixed —the value of the entry, as it was passed to CacheInterface::set, null if not present in cache
has()
Tests whether the cache has a value for a particular key
public
has(string $key) : bool
Parameters
- $key : string
-
the key of the cache entry
Return values
bool —true if the cache has a value for this key, otherwise false
set()
Stores a new cache entry
public
set(string $key, stdClass $value, int $ttl) : void
Parameters
- $key : string
-
the key of the cache entry
- $value : stdClass
-
the value of the entry
- $ttl : int
-
the time until this cache entry expires