CacheStorage
extends
Serializable
in
The interface of the cache storage driver.
Tags
Table of Contents
- clear() : mixed
- Clears all data from the cache.
- exists() : bool
- Checks if a given key exists in the cache, valid for the given lifetime.
- expire() : bool
- Expire any existing data for the given key.
- get() : mixed
- Retrieve cached data.
- set() : mixed
- Store an object in the cache.
- setLogger() : void
- Set the logging object.
Methods
clear()
Clears all data from the cache.
public
clear() : mixed
Tags
Return values
mixed —exists()
Checks if a given key exists in the cache, valid for the given lifetime.
public
exists(string $key, int $lifetime) : bool
Parameters
- $key : string
-
Cache key to check.
- $lifetime : int
-
Lifetime of the key in seconds.
Return values
bool —Existence.
expire()
Expire any existing data for the given key.
public
expire(string $key) : bool
Parameters
- $key : string
-
Cache key to expire.
Return values
bool —Success or failure.
get()
Retrieve cached data.
public
get(string $key, int $lifetime) : mixed
Parameters
- $key : string
-
Object ID to query.
- $lifetime : int
-
Lifetime of the object in seconds.
Return values
mixed —Cached data, or false if none was found.
set()
Store an object in the cache.
public
set(string $key, mixed $data, int $lifetime) : mixed
Parameters
- $key : string
-
Object ID used as the caching key.
- $data : mixed
-
Data to store in the cache.
- $lifetime : int
-
Object lifetime - i.e. the time before the data becomes available for garbage collection. If 0 will not be GC'd.
Return values
mixed —setLogger()
Set the logging object.
public
setLogger(Horde_Log_Logger $logger) : void
Parameters
- $logger : Horde_Log_Logger
-
Log object.