lithium\storage\cache\adapter\Redis::_formatHost()

protected method

Formats standard 'host:port' or '/path/to/socket' strings

Parameters

  • mixed $host

    A host string in 'host:port' or '/path/to/socket' format

Returns

array

Returns an array of Redis connection definitions.

Source

	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);
	}