This is a resource manager for redis

package Default

 Methods

Get redis resource database

getDatabase(string $id) : string

Parameters

$id

string

Returns

string

Get one Redis option

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

Parameters

$id

string

$key

stringinteger

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) : integer

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

integer

Get redis server version

getMayorVersion(string $id) : integer
deprecated 2.2.2 Use getMajorVersion instead

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

integer

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) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManager

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) : boolean

Parameters

$id

string

Returns

boolean

Remove a resource

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

Parameters

$id

string

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManagerFluent interface

Set redis database number

setDatabase(string $id, integer $database) : \Zend\Cache\Storage\Adapter\RedisResourceManager

Parameters

$id

string

$database

integer

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManager

Set one Redis option

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

Parameters

$id

string

$key

stringinteger

$value

mixed

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManagerFluent interface

Set Redis options

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

Parameters

$id

string

$libOptions

array

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManagerFluent interface

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

\Zend\Cache\Storage\Adapter\RedisResourceManagerFluent interface

Set a resource

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

Parameters

$id

string

$resource

array\Traversable\Redis

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManagerFluent interface

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

\Zend\Cache\Storage\Adapter\RedisResourceManager

Connects to redis server

connect(array $resource) : null

Parameters

$resource

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

null

Extract password to be used on connection

extractPassword(mixed $resource, mixed $serverUri) : string | null

Parameters

$resource

mixed

$serverUri

mixed

Returns

stringnull

Convert option name into it's constant value

normalizeLibOptionKey(string|integer $key) 

Parameters

$key

stringinteger

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

Default

array()