RedisAdapter
extends AbstractAdapter
in package
uses
RedisTrait
Table of Contents
Methods
- __construct() : mixed
- commit() : bool
- Persists any deferred cache items.
- createConnection() : mixed
- createSystemCache() : AdapterInterface
- Returns the best possible adapter that your runtime supports.
Methods
__construct()
public
__construct(Redis|RedisArray|RedisCluster|ClientInterface|Relay $redis[, string $namespace = '' ][, int $defaultLifetime = 0 ][, MarshallerInterface|null $marshaller = null ]) : mixed
Parameters
- $redis : Redis|RedisArray|RedisCluster|ClientInterface|Relay
- $namespace : string = ''
- $defaultLifetime : int = 0
- $marshaller : MarshallerInterface|null = null
commit()
Persists any deferred cache items.
public
commit() : bool
Return values
bool —True if all not-yet-saved items were successfully saved or there were none. False otherwise.
createConnection()
public
static createConnection(string $dsn[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $dsn : string
- $options : array<string|int, mixed> = []
createSystemCache()
Returns the best possible adapter that your runtime supports.
public
static createSystemCache(string $namespace, int $defaultLifetime, string $version, string $directory[, LoggerInterface|null $logger = null ]) : AdapterInterface
Using ApcuAdapter makes system caches compatible with read-only filesystems.
Parameters
- $namespace : string
- $defaultLifetime : int
- $version : string
- $directory : string
- $logger : LoggerInterface|null = null