RedisStorage
Extends \Joomla\CMS\Cache\CacheStorageRedis cache storage handler for PECL
since |
3.4 |
---|
Methods
__construct
Constructor
__construct(array $options = array())
since |
1.7.0 |
---|
Arguments
- $options
array
Optional parameters
_getCacheId
Get a cache ID string from an ID/group pair
_getCacheId(string $id, string $group) : string
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group
Response
string
addIncludePath
Add a directory where CacheStorage should search for handlers. You may either pass a string or an array of directories.
addIncludePath(array|string $path = '') : array
since |
1.7.0 |
---|
Arguments
- $path
array|string
A path to search.
Response
array
An array with directory elements
clean
Clean cache for a group given a mode.
clean(string $group, string $mode = null) : boolean
group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group
since |
1.7.0 |
---|
Arguments
- $group
string
The cache data group- $mode
string
The mode for cleaning cache [group|notgroup]
Response
boolean
contains
Check if the cache contains data stored by ID and group
contains(string $id, string $group) : boolean
since |
3.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group
Response
boolean
flush
Flush all existing items in storage.
flush() : boolean
since |
3.6.3 |
---|
Response
boolean
gc
Garbage collect expired cache data
gc() : boolean
since |
1.7.0 |
---|
Response
boolean
get
Get cached data by ID and group
get(string $id, string $group, boolean $checkTime = true) : mixed
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group- $checkTime
boolean
True to verify cache time expiration threshold
Response
mixed
Boolean false on failure or a cached data object
getAll
Get all cached data
getAll() : mixed
since |
1.7.0 |
---|
Response
mixed
Boolean false on failure or a cached data object
getConnection
Create the Redis connection
getConnection() : \Redis|boolean
since |
3.4 |
---|---|
note |
As of 4.0 this method will throw a JCacheExceptionConnecting object on connection failure |
Response
\Redis|boolean
Redis connection object on success, boolean on failure
getInstance
Returns a cache storage handler object.
getInstance(string $handler = null, array $options = array()) : \Joomla\CMS\Cache\CacheStorage
since |
1.7.0 |
---|---|
throws |
|
Arguments
- $handler
string
The cache storage handler to instantiate- $options
array
Array of handler options
Response
isConnected
Test to see if the Redis connection is available.
isConnected() : boolean
since |
3.4 |
---|
Response
boolean
isSupported
Test to see if the storage handler is available.
isSupported() : boolean
since |
3.0.0 |
---|
Response
boolean
lock
Lock cached item
lock(string $id, string $group, integer $locktime) : mixed
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group- $locktime
integer
Cached item max lock time
Response
mixed
Boolean false if locking failed or an object containing properties lock and locklooped
remove
Remove a cached data entry by ID and group
remove(string $id, string $group) : boolean
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group
Response
boolean
store
Store the data to cache by ID and group
store(string $id, string $group, string $data) : boolean
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group- $data
string
The data to store in cache
Response
boolean
test
Test to see if the storage handler is available.
test() : boolean
since |
1.7.0 |
---|---|
deprecated |
4.0 |
Response
boolean
unlock
Unlock cached item
unlock(string $id, string $group = null) : boolean
since |
1.7.0 |
---|
Arguments
- $id
string
The cache data ID- $group
string
The cache data group
Response
boolean
Properties
_redis
Redis connection object
since |
3.4 |
---|
Type(s)
\Redis
_persistent
Persistent session flag
since |
3.4 |
---|
Type(s)
boolean
rawname
The raw object name
since |
1.7.0 |
---|
Type(s)
string
_now
Time that the cache storage handler was instantiated
since |
1.7.0 |
---|
Type(s)
integer
_lifetime
Cache lifetime
since |
1.7.0 |
---|
Type(s)
integer
_locking
Flag if locking is enabled
since |
1.7.0 |
---|
Type(s)
boolean
_language
Language code
since |
1.7.0 |
---|
Type(s)
string
_application
Application name
since |
1.7.0 |
---|
Type(s)
string
_hash
Object hash
since |
1.7.0 |
---|
Type(s)
string