ApcCache
in package
implements
Cache
APC cache provider may be used by the DeviceApi and DeviceApiWeb to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files.
Tags
Table of Contents
Interfaces
- Cache
- Cache interface for the DeviceAtlas APIs.
Properties
- $cacheItemExpiry : mixed
Methods
- __construct() : mixed
- Construct a CacheProvider object.
- clear() : bool
- Clear the whole cache.
- delete() : bool
- Remove an item from the cache.
- get() : mixed
- Get a stored value form cache.
- put() : bool
- Store a value in cache.
Properties
$cacheItemExpiry
private
mixed
$cacheItemExpiry
Methods
__construct()
Construct a CacheProvider object.
public
__construct([mixed $cacheItemExpiry = 86400 ]) : mixed
Parameters
- $cacheItemExpiry : mixed = 86400
clear()
Clear the whole cache.
public
clear() : bool
Return values
bool —true=cache cleared
delete()
Remove an item from the cache.
public
delete(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —true=cache deleted
get()
Get a stored value form cache.
public
get(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —the cached value or null if the key does not exist in cache
put()
Store a value in cache.
public
put(mixed $key, mixed $value) : bool
Parameters
- $key : mixed
- $value : mixed
Tags
Return values
bool —true=cache stored