simple local development / testing cluster
use Basho\Riak\Node;
$nodes = (new Node\Builder)
->buildLocalhost([10018, 10028, 10038, 10048, 10058]);
password authentication to production cluster
use Basho\Riak\Node;
$nodes = (new Node\Builder)
->onPort(8098)
->usingPasswordAuthentication('riakuser', 'riakpassword')
->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem')
->buildCluster(['riak1.company.int','riak2.company.int','riak3.company.int']);
certificate authentication to production load balanced cluster
use Basho\Riak\Node;
$node = (new Node\Builder)
->atHost('riak.company.int')
->onPort(8098)
->usingCertificateAuthentication(getcwd() . '/path/to/client.crt')
->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem')
->build();
pam authentication to production load balanced cluster
use Basho\Riak\Node;
$node = (new Node\Builder)
->atHost('riak.company.int')
->onPort(8098)
->usingPamAuthentication('riakuser')
->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem')
->build();
Datei anzeigen
Open project: basho/riak-php-client
Property | Type | Description | |
---|---|---|---|
$config | Internal storage |
Method | Description | |
---|---|---|
__construct ( ) | ||
atHost ( $host ) | Build with host address | |
build ( ) : |
Build node | |
buildCluster ( array $hosts = ['localhost'] ) : |
Build distributed cluster | |
buildLocalhost ( array $ports = [8087] ) : |
Build local node cluster | |
getConfig ( ) : |
||
onPort ( $port ) | Build node objects with configuration to use a specific port number | |
usingCertificateAuthentication ( $certificate, string $password = '' ) | usingCertificateAuthentication | |
usingPamAuthentication ( $user ) | usingPamAuthentication | |
usingPasswordAuthentication ( $user, $pass = '' ) | usingPasswordAuthentication | |
usingTrustAuthentication ( string $user = '' ) | usingTrustAuthentication | |
withCertificateAuthorityDirectory ( $ca_directory ) | withCertificateAuthorityDirectory | |
withCertificateAuthorityFile ( $ca_file ) | withCertificateAuthorityDirectory | |
withConnectionTimeout ( $timeout ) | Client side connection timeout for requests | |
withPrivateKey ( $private_key, $password = '' ) | ||
withStreamTimeout ( $timeout ) | Client side socket read/write timeout for requests |
Method | Description | |
---|---|---|
validate ( ) | Builder configuration validation |
public atHost ( $host ) | ||
$host |
public build ( ) : |
||
return |
public buildCluster ( array $hosts = ['localhost'] ) : |
||
$hosts | array | |
return |
public buildLocalhost ( array $ports = [8087] ) : |
||
$ports | array | |
return |
public onPort ( $port ) | ||
$port |
public usingCertificateAuthentication ( $certificate, string $password = '' ) | ||
$certificate | ||
$password | string |
public usingPamAuthentication ( $user ) | ||
$user |
public usingPasswordAuthentication ( $user, $pass = '' ) | ||
$user | ||
$pass |
public usingTrustAuthentication ( string $user = '' ) | ||
$user | string |
protected validate ( ) |
public withCertificateAuthorityDirectory ( $ca_directory ) | ||
$ca_directory |
public withCertificateAuthorityFile ( $ca_file ) | ||
$ca_file |
public withConnectionTimeout ( $timeout ) | ||
$timeout |
public withStreamTimeout ( $timeout ) | ||
$timeout |
protected Config,Basho\Riak\Node|null $config | ||
return |