FileAccess Orion

RedisResourceManager
in package

This is a resource manager for redis

Table of Contents

$resources  : array<string|int, mixed>
Registered resources
getDatabase()  : string
Get redis resource database
getLibOption()  : mixed
Get one Redis option
getLibOptions()  : array<string|int, mixed>
Get Redis options
getMajorVersion()  : int
Get redis major server version
getMayorVersion()  : int
Get redis server version
getPassword()  : string
Get redis resource password
getPersistentId()  : string
Get the persistent id
getResource()  : Redis
Gets a redis resource
getServer()  : array<string|int, mixed>
Get server
getVersion()  : string
Get redis server version
hasResource()  : bool
Check if a resource exists
removeResource()  : RedisResourceManager
Remove a resource
setDatabase()  : RedisResourceManager
Set redis database number
setLibOption()  : RedisResourceManager
Set one Redis option
setLibOptions()  : RedisResourceManager
Set Redis options
setPassword()  : Redis
Set redis password
setPersistentId()  : RedisResourceManager
Set the persistent id
setResource()  : RedisResourceManager
Set a resource
setServer()  : RedisResourceManager
Set server
connect()  : null
Connects to redis server
extractPassword()  : string|null
Extract password to be used on connection
normalizeLibOptionKey()  : mixed
Convert option name into it's constant value
normalizeLibOptions()  : mixed
Normalize Redis options
normalizePersistentId()  : mixed
Normalize the persistent id
normalizeServer()  : mixed
Normalize one server into the following format: array('host' => <host>[, 'port' => <port>[, 'timeout' => <timeout>]])

Properties

Methods

getDatabase()

Get redis resource database

public getDatabase(string $id) : string
Parameters
$id : string
Return values
string

getLibOption()

Get one Redis option

public getLibOption(string $id, string|int $key) : mixed
Parameters
$id : string
$key : string|int
Tags
throws
RuntimeException
Return values
mixed

getLibOptions()

Get Redis options

public getLibOptions(string $id) : array<string|int, mixed>
Parameters
$id : string
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

getMajorVersion()

Get redis major server version

public getMajorVersion(string $resourceId) : int
Parameters
$resourceId : string
Tags
throws
RuntimeException
Return values
int

getMayorVersion()

Get redis server version

public getMayorVersion(string $id) : int
Parameters
$id : string
Tags
deprecated
2.2.2

Use getMajorVersion instead

throws
RuntimeException
Return values
int

getPassword()

Get redis resource password

public getPassword(string $id) : string
Parameters
$id : string
Return values
string

getServer()

Get server

public getServer(string $id) : array<string|int, mixed>
Parameters
$id : string
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

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

getVersion()

Get redis server version

public getVersion(string $resourceId) : string
Parameters
$resourceId : string
Tags
throws
RuntimeException
Return values
string

hasResource()

Check if a resource exists

public hasResource(string $id) : bool
Parameters
$id : string
Return values
bool

setPassword()

Set redis password

public setPassword(string $id, string $password) : Redis
Parameters
$id : string
$password : string
Return values
Redis

setServer()

Set server

public setServer(string $id, string|array<string|int, mixed> $server) : RedisResourceManager

Server can be described as follows:

  • URI: /path/to/sock.sock
  • Assoc: array('host' => [, 'port' => [, 'timeout' => ]])
  • List: array([, , [, ]])
Parameters
$id : string
$server : string|array<string|int, mixed>
Return values
RedisResourceManager

connect()

Connects to redis server

protected connect(array<string|int, mixed> &$resource) : null
Parameters
$resource : array<string|int, mixed>
Tags
throws
RuntimeException
Return values
null

extractPassword()

Extract password to be used on connection

protected extractPassword(mixed $resource, mixed $serverUri) : string|null
Parameters
$resource : mixed
$serverUri : mixed
Return values
string|null

normalizeLibOptionKey()

Convert option name into it's constant value

protected normalizeLibOptionKey(string|int &$key) : mixed
Parameters
$key : string|int
Tags
throws
InvalidArgumentException
Return values
mixed

normalizeLibOptions()

Normalize Redis options

protected normalizeLibOptions(array<string|int, mixed>|Traversable &$libOptions) : mixed
Parameters
$libOptions : array<string|int, mixed>|Traversable
Tags
throws
InvalidArgumentException
Return values
mixed

normalizePersistentId()

Normalize the persistent id

protected normalizePersistentId(string &$persistentId) : mixed
Parameters
$persistentId : string
Return values
mixed

normalizeServer()

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

protected normalizeServer(string|array<string|int, mixed> &$server) : mixed
Parameters
$server : string|array<string|int, mixed>
Tags
throws
InvalidArgumentException
Return values
mixed

Search results