Redis
Extends \Joomla\Cache\CacheRedis cache driver for the Joomla Framework.
since |
1.0 |
---|---|
deprecated |
The joomla/cache package is deprecated |
Methods
__construct
Constructor.
__construct(mixed $options = array())
since |
1.0 |
---|---|
throws |
|
Arguments
- $options
mixed
An options array, or an object that implements \ArrayAccess
clear
This will wipe out the entire cache's keys
clear() : boolean
since |
1.0 |
---|
Response
boolean
The result of the clear operation.
connect
Connect to the Redis servers if the connection does not already exist.
connect() : void
since |
1.0 |
---|
exists
Method to determine whether a storage entry has been set for a key.
exists(string $key) : boolean
since |
1.0 |
---|
Arguments
- $key
string
The storage entry identifier.
Response
boolean
get
Get cached data by id. If the cached data has expired then the cached data will be removed and false will be returned.
get(string $key) : \Psr\Cache\CacheItemInterface
since |
1.0 |
---|
Arguments
- $key
string
The cache data id.
Response
\Psr\Cache\CacheItemInterface
Cached data string if it exists.
getMultiple
Obtain multiple CacheItems by their unique keys.
getMultiple(array $keys) : array
since |
1.0 |
---|
Arguments
- $keys
array
A list of keys that can obtained in a single operation.
Response
array
An associative array of CacheItem objects keyed on the cache key.
getOption
Get an option from the Cache instance.
getOption(string $key) : mixed
since |
1.0 |
---|
Arguments
- $key
string
The name of the option to get.
Response
mixed
The option value.
remove
Delete a cached data entry by id.
remove(string $key) : boolean
since |
1.0 |
---|
Arguments
- $key
string
The cache data id.
Response
boolean
removeMultiple
Remove multiple cache items in a single operation.
removeMultiple(array $keys) : array
since |
1.0 |
---|
Arguments
- $keys
array
The array of keys to be removed.
Response
array
An associative array of 'key' => result, elements. Each array row has the key being deleted
and the result of that operation. The result will be a boolean of true or false
representing if the cache item was removed or not
set
Store the cached data by id.
set(string $key, mixed $data, integer $ttl = null) : boolean
since |
1.0 |
---|
Arguments
- $key
string
The cache data id- $data
mixed
The data to store- $ttl
integer
The number of seconds before the stored data expires.
Response
boolean
setMultiple
Persisting a set of key => value pairs in the cache, with an optional TTL.
setMultiple(array $items, null|integer $ttl = null) : boolean
since |
1.0 |
---|
Arguments
- $items
array
An array of key => value pairs for a multiple-set operation.- $ttl
null|integer
Optional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.
Response
boolean
The result of the multiple-set operation.
setOption
Set an option for the Cache instance.
setOption(string $key, mixed $value) : \Joomla\Cache\Cache
since |
1.0 |
---|
Arguments
- $key
string
The name of the option to set.- $value
mixed
The option value to set.
Response
\Joomla\Cache\Cache
This object for method chaining.
Constants
REDIS_HOST
Default hostname of redis server
REDIS_PORT
Default port of redis server
Properties
driver
The redis driver.
since |
1.0 |
---|
Type(s)
\Redis
options
The options for the cache object.
since |
1.0 |
---|
Type(s)
\ArrayAccess