This is a resource manager for redis

 Methods

Get redis resource database

getDatabase(string $id) : string

Parameters

$id

string

Returns

string

Get one Redis option

getLibOption(string $id, string | int $key) : mixed

Parameters

$id

string

$key

stringint

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

mixed

Get Redis options

getLibOptions(string $id) : array

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

array

Get redis server version

getMajorVersion(string $id) : int

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

int

Get redis server version

getMayorVersion(string $id) : int

deprecated 2.2.2 Use getMajorVersion instead

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

int

Get redis resource password

getPassword(string $id) : string

Parameters

$id

string

Returns

string

Get the persistent id

getPersistentId(string $id) : string

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

string

Gets a redis resource

getResource(string $id) : \Redis

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

\Redis

Get server

getServer(string $id) : array

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

arrayarray('host' => [, 'port' => [, 'timeout' => ]])

Check if a resource exists

hasResource(string $id) : bool

Parameters

$id

string

Returns

bool

Remove a resource

removeResource(string $id) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

Returns

Set redis database number

setDatabase(string $id, int $database) : \Redis

Parameters

$id

string

$database

int

Returns

\Redis

Set one Redis option

setLibOption(string $id, string | int $key, mixed $value) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

$key

stringint

$value

mixed

Returns

Set Redis options

setLibOptions(string $id, array $libOptions) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

$libOptions

array

Returns

Set redis password

setPassword(string $id, string $password) : \Redis

Parameters

$id

string

$password

string

Returns

\Redis

Set the persistent id

setPersistentId(string $id, string $persistentId) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

$persistentId

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

Set a resource

setResource(string $id, array | \Traversable | \Redis $resource) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

$resource

array\Traversable\Redis

Returns

Set server

setServer(string $id, string | array $server) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Server can be described as follows: - URI: /path/to/sock.sock - Assoc: array('host' => [, 'port' => [, 'timeout' => ]]) - List: array([, , [, ]])

Parameters

$id

string

$server

stringarray

Returns

Connects to redis server

connect(array $resource) : null

Parameters

$resource

array

& $resource

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

null

Convert option name into it's constant value

normalizeLibOptionKey(string | int $key) 

Parameters

$key

stringint

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Normalize Redis options

normalizeLibOptions(array | \Traversable $libOptions) 

Parameters

$libOptions

array\Traversable

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Normalize the persistent id

normalizePersistentId(string $persistentId) 

Parameters

$persistentId

string

Normalize one server into the following format: array('host' => <host>[, 'port' => <port>[, 'timeout' => <timeout>]])

normalizeServer(string | array $server) 

Parameters

$server

stringarray

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

 Properties

 

Registered resources

$resources : array