ApcuCache
in package
implements
CacheInterface
APCu cache driver.
Table of Contents
Interfaces
- CacheInterface
- Cache interface
Properties
- $options : array<string|int, mixed>
- Driver options
Methods
- __construct() : mixed
- Constructor
- clear() : bool
- Delete all cache items.
- delete() : bool
- Delete cache entry.
- fetch() : mixed|false
- Fetch entry.
- getStats() : array<string|int, mixed>|null
- Return cache stats
- has() : bool
- Check if cache contains item
- save() : bool
- Save data into the cache.
Properties
$options
Driver options
protected
array<string|int, mixed>
$options
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
clear()
Delete all cache items.
public
clear() : bool
Return values
booldelete()
Delete cache entry.
public
delete(string $id) : bool
Parameters
- $id : string
-
cache id.
Return values
boolfetch()
Fetch entry.
public
fetch(string $id) : mixed|false
Parameters
- $id : string
Return values
mixed|false —The cached data or false
getStats()
Return cache stats
public
getStats() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullhas()
Check if cache contains item
public
has(string $id) : bool
Parameters
- $id : string
Return values
boolsave()
Save data into the cache.
public
save(string $id, mixed $data[, int $lifeTime = 0 ]) : bool
Parameters
- $id : string
-
The cache id.
- $data : mixed
-
The cache entry/data.
- $lifeTime : int = 0
Return values
bool —true if data was successfully stored in the cache, false otherwise.