library/Rediska.php
public function addServer($host, $port = Rediska_Connection::DEFAULT_PORT, array $options = array())
    {
        if (!isset($options['alias'])) {
            $connectionString = "$host:$port";
        } else {
            $connectionString = $options['alias'];
        }

        if (array_key_exists($connectionString, $this->_connections)) {
            throw new Rediska_Exception("Server '$connectionString' already added.");
        }

        $options['host'] = $host;
        $options['port'] = $port;

        if (isset($options['useSocket'])) {
            if ($options['useSocket'] == true) {
                $connectionClass = static::CONNECTION_SOCKET_CLASS;
            }
            unset($options['useSocket']);
        } else {
            $connectionClass = static::CONNECTION_CLASS;
        }

        $this->_connections[$connectionString] = new $connectionClass($options);

        if ($this->_keyDistributor) {
            $this->_keyDistributor->addConnection(
                $connectionString,
                isset($options['weight']) ? $options['weight'] : Rediska_Connection::DEFAULT_WEIGHT
            );
        }

        return $this;
    }
public function addServer($host, $port = Rediska_Connection::DEFAULT_PORT, array $options = array())
    {
        if (!isset($options['alias'])) {
            $connectionString = "$host:$port";
        } else {
            $connectionString = $options['alias'];
        }

        if (array_key_exists($connectionString, $this->_connections)) {
            throw new Rediska_Exception("Server '$connectionString' already added.");
        }

        $options['host'] = $host;
        $options['port'] = $port;

        if (isset($options['useSocket'])) {
            if ($options['useSocket'] == true) {
                $connectionClass = static::CONNECTION_SOCKET_CLASS;
            }
            unset($options['useSocket']);
        } else {
            $connectionClass = static::CONNECTION_CLASS;
        }

        $this->_connections[$connectionString] = new $connectionClass($options);

        if ($this->_keyDistributor) {
            $this->_keyDistributor->addConnection(
                $connectionString,
                isset($options['weight']) ? $options['weight'] : Rediska_Connection::DEFAULT_WEIGHT
            );
        }

        return $this;
    }
Add server

@throws Rediska_Exception
@param string $host Hostname or IP
@param integer $port Port
@param array $options Options see: Rediska_Connection
@return Rediska