Cache adapter.
Constructor.
| Type | Description |
|---|---|
| string | Cache identifier |
NULL
public function __construct($identifier)
{
$this->identifier = md5($identifier);
}
NULL
abstract public function write($key, $value, $ttl = 0);
NULL
abstract public function read($key);
NULL
abstract public function delete($key);
NULL
abstract public function clear();
Fetches variable from cache and stores it if it doesn't exist.
| Type | Description |
|---|---|
| string | Cache key |
| closure | Closure (anonymous function) that returns value to store if it doesn't already exist |
| int | (optional) Time to live |
mixed
Magic setter.
| Type | Description |
|---|---|
| string | Cache key |
| mixed | The variable to store |
NULL
Magic getter.
| Type | Description |
|---|---|
| string | Cache key |
mixed
Magic isset.
| Type | Description |
|---|---|
| string | Cache key |
boolean
Magic unsetter.
| Type | Description |
|---|---|
| string | Cache key |
NULL