protected _formatHost ( mixed $host ) : array | ||
$host | mixed | A host string in `'host:port'` or `'/path/to/socket'` format |
return | array | Returns an array of `Redis` connection definitions. |
protected function _formatHost($host)
{
if (strpos($host, ':') > 0) {
list($address, $port) = explode(':', $host);
} else {
$address = $host;
$port = strpos($host, '/') === 0 ? null : self::CONN_DEFAULT_PORT;
}
return array($address, $port);
}