Basho\Riak::__construct PHP Méthode

__construct() public méthode

Construct a new Client object, defaults to port 8098.
public __construct ( array $nodes, array $config = [], Basho\Riak\Api $api = NULL )
$nodes array an array of Basho\Riak\Node objects
$config array a configuration object
$api Basho\Riak\Api
    public function __construct(array $nodes, array $config = [], Api $api = NULL)
    {
        // wash any custom keys if any
        $this->nodes = array_values($nodes);
        $this->setActiveNodeIndex($this->pickNode());
        if (!empty($config)) {
            // use php array merge so passed in config overrides defaults
            $this->config = array_merge($this->config, $config);
        }
        if ($api) {
            $this->api = $api;
        } else {
            // default to HTTP bridge class
            $this->api = new Http($this->config);
        }
    }