The cache frontend.
protected Backend $backend
Cache object constructor.
public __construct({Array})
Parameter | Type | Description |
---|
$backend | string | The name of the backend to use. Currently 'apc', 'file', 'memcached', 'session' and |
'sqlite' are supported. |
| $configOptions
| Map
| | | $namespace
| string
| The namespace to use for grouping stored data |
public __destruct({Array})
Parameter | Type | Description |
---|
$key | string | |
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
Parameter | Type | Description |
---|
$key | string | |
Parameter | Type | Description |
---|
$feature | string | |
public configure({Array})
Parameter | Type | Description |
---|
$options | Map | |
public getBackend({Array})
public setBackendOption({Array})
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
Parameter | Type | Description |
---|
$key | string | |
Parameter | Type | Description |
---|
$key | string | |
Retrieve a value from cache storage.
Parameter | Type | Description |
---|
$key | string | The reference key used to store the value |
$default | mixed | If the value doesn't exist, this default will be returned instead |
$saveDefault | bool | If the value doesn't exist and a default is specified, save that default to cache |
$timeout | int | |
Store a value in the cache using the current cache backend.
Parameter | Type | Description |
---|
$key | string | The reference key under which to store the value |
$value | mixed | The value that should be stored. Values can be pretty much anything including integers, booleans, |
strings and any object that can be serialised. |
| $timeout
| int
| The number of seconds after which the value becomes invalid. If not set the global 'lifetime' option is used. Set a value of '-1' to indicate that the value should never timeout. |
Check if a stored value exists.
Parameter | Type | Description |
---|
$key | string | The value key to check for |
$checkEmpty | bool | Normally this method will return try if the value exists with $key . Setting $checkEmpty looks at the value |
and will return false if it is an 'empty' value (ie: 0, null, []) |
Removes a stored value.
Parameter | Type | Description |
---|
$key | string | The key of the value to remove |
Extend the cache with an array of key/value pairs.
Parameter | Type | Description |
---|
$array | array | The array of key/value pairs to store in the cache |
$recursive | bool | |
Set multiple values in the cache.
Parameter | Type | Description |
---|
$values | array | |
Parameter | Type | Description |
---|
$key | string | |
Retrieve all values from the cache.
Disable the use of cache.
This allows a cache object to be disabled but still be used without having to modify existing application code. The application can still call the get() method but it will always return false, simulating a negative cache response. Calling set() will still have an affect however.
Enable the use of cache.
Cache is enabled by default. This is to allow cache to be re-enabled after calling off().
This method can also be used to force cache back on after being disabled by a "Pragma: no-cache" header in the case where the use_pragma setting is enabled (which is the default).
Parameter | Type | Description |
---|
$key | string | |
public offsetExists({Array})
Parameter | Type | Description |
---|
$offset | `````` | |
public offsetGet({Array})
Parameter | Type | Description |
---|
$offset | `````` | |
public offsetSet({Array})
Parameter | Type | Description |
---|
$offset | `````` | |
$value | `````` | |
public offsetUnset({Array})
Parameter | Type | Description |
---|
$offset | `````` | |
Increment key value.
public increment({Array})
This method will increment a cached integer value by a defined amount (default is 1). Once the value is incremented it will be stored back in the cache and the new value returned.
Parameter | Type | Description |
---|
$key | string | The cache key |
$amount | int | the amount to increment the value by |
Decrement key value.
public decrement({Array})
This method will decrement a cached integer value by a defined amount (default is 1). Once the value is decremented it will be stored back in the cache and the new value returned.
Parameter | Type | Description |
---|
$key | string | The cache key |
$amount | int | the amount to decrement the value by |
Generated by Hazaar API Doc Generator