PHP Класс Bravo3\Orm\Drivers\Redis\SentinelMonitor

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$client Predis\Client

Открытые методы

Метод Описание
__construct ( mixed $connection_params = null ) Create a new Sentinel Monitor.
findMasters ( ) : array Return an array of MASTER servers in the form that can be passed to Predis Client.
findSentinels ( string $master_name = 'mymaster' ) : array Return an array of SENTINEL servers in the form that can be passed to Predis Client.
findSlaves ( string $master_name = null ) : array Return an array of SLAVE servers in the form that can be passed to Predis Client.

Защищенные методы

Метод Описание
getConnectionParams ( array $sentinel_output, string $alias = null ) : array | null Return an array of formatted output from Sentinel to be used as Redis connection parameters for the Predis client.
validateConnection ( array $host_info ) : boolean Function returns true if connection to redis host is accessible based on the output received from Sentinel.

Описание методов

__construct() публичный Метод

If more than one sentinel server parameters are provided, the first sentinel that connects will be used for retrival of information.
public __construct ( mixed $connection_params = null )
$connection_params mixed

findMasters() публичный Метод

Return an array of MASTER servers in the form that can be passed to Predis Client.
public findMasters ( ) : array
Результат array

findSentinels() публичный Метод

Return an array of SENTINEL servers in the form that can be passed to Predis Client.
public findSentinels ( string $master_name = 'mymaster' ) : array
$master_name string
Результат array

findSlaves() публичный Метод

If $master_name parameter is not set this function will return slaves attached to all connected master servers.
public findSlaves ( string $master_name = null ) : array
$master_name string
Результат array

getConnectionParams() защищенный Метод

Inactive connection parameters will be removed if sentinel reports services as inactive.
protected getConnectionParams ( array $sentinel_output, string $alias = null ) : array | null
$sentinel_output array
$alias string Redis DB connection type "master" or "slave"
Результат array | null

validateConnection() защищенный Метод

Function returns true if connection to redis host is accessible based on the output received from Sentinel.
protected validateConnection ( array $host_info ) : boolean
$host_info array
Результат boolean

Описание свойств

$client защищенное свойство

protected Client,Predis $client
Результат Predis\Client