Credis_Client::__construct PHP Method

__construct() public method

$host may also be a path to a unix socket or a string in the form of tcp://[hostname]:[port] or unix://[path]
public __construct ( string $host = '127.0.0.1', integer $port = 6379, float $timeout = null, string $persistent = '', integer $db, string $password = null )
$host string The hostname of the Redis server
$port integer The port number of the Redis server
$timeout float Timeout period in seconds
$persistent string Flag to establish persistent connection
$db integer The selected datbase of the Redis server
$password string The authentication password of the Redis server
    public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null)
    {
        $this->host = (string) $host;
        $this->port = (int) $port;
        $this->timeout = $timeout;
        $this->persistent = (string) $persistent;
        $this->standalone = !extension_loaded('redis');
        $this->authPassword = $password;
        $this->selectedDb = (int) $db;
        $this->convertHost();
    }