RedisDriver
extends AbstractDriver
in package
Redis cache backend
Table of Contents
- __construct() : mixed
- RedisDriver constructor.
- __destruct() : mixed
- Disconnect from redis server
- delete() : bool
- Remove an item from the cache
- deleteMultiple() : bool
- Remove multiple items from the cache
- exists() : bool
- See if a key currently exists in the cache
- expiresAt() : bool
- Set the expiration timestamp of a key
- flush() : bool
- Empty the cache
- get() : mixed
- Get the value for the selected cache key
- getMultiple() : array<string|int, mixed>
- Retrieve a set of values by their cache key
- set() : bool
- Set a cached value
- setLogger() : void
- Set a logger to keep track of errors
- setMultiple() : bool
- Set multiple cache values
Methods
__construct()
RedisDriver constructor.
public
__construct([array<string|int, mixed> $config = [] ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $config : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
-
- Predis library connection options
Tags
Return values
mixed —__destruct()
Disconnect from redis server
public
__destruct() : mixed
Tags
Return values
mixed —delete()
Remove an item from the cache
public
delete(string $key) : bool
Parameters
- $key : string
Return values
bool —deleteMultiple()
Remove multiple items from the cache
public
deleteMultiple([array<string|int, string> $keys = [] ]) : bool
Parameters
- $keys : array<string|int, string> = []
Return values
bool —exists()
See if a key currently exists in the cache
public
exists(string $key) : bool
Parameters
- $key : string
Return values
bool —expiresAt()
Set the expiration timestamp of a key
public
expiresAt(string $key, int $expires) : bool
Parameters
- $key : string
- $expires : int
Return values
bool —flush()
Empty the cache
public
flush() : bool
Return values
bool —get()
Get the value for the selected cache key
public
get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —getMultiple()
Retrieve a set of values by their cache key
public
getMultiple([array<string|int, string> $keys = [] ]) : array<string|int, mixed>
Parameters
- $keys : array<string|int, string> = []
Return values
array<string|int, mixed> —set()
Set a cached value
public
set(string $key, mixed $value[, DateInterval|int|null $expires = NULL ]) : bool
Parameters
- $key : string
- $value : mixed
- $expires : DateInterval|int|null = NULL
Return values
bool —setLogger()
Set a logger to keep track of errors
public
setLogger(LoggerInterface $logger) : void
Parameters
- $logger : LoggerInterface
Return values
void —setMultiple()
Set multiple cache values
public
setMultiple(array<string|int, mixed> $items[, DateInterval|int|null $expires = NULL ]) : bool
Parameters
- $items : array<string|int, mixed>
- $expires : DateInterval|int|null = NULL