class Cluster (View source)

Represents a Couchbase Server Cluster.

It is an entry point to the library, and in charge of opening connections to the Buckets. In addition it can instantiate \Couchbase\ClusterManager to peform cluster-wide operations.

Methods

__construct(string $connstr)

Create cluster object

openBucket(string $name = "default", string $password = "")

Open connection to the Couchbase bucket

manager(string $username = null, string $password = null)

Open management connection to the Couchbase cluster.

null
authenticate(Authenticator $authenticator)

Associate authenticator with Cluster

null
authenticateAs(string $username, string $password)

Create \Couchbase\PasswordAuthenticator from given credentials and associate it with Cluster

Details

__construct(string $connstr)

Create cluster object

Parameters

string $connstr

connection string

Bucket openBucket(string $name = "default", string $password = "")

Open connection to the Couchbase bucket

Parameters

string $name

Name of the bucket.

string $password

Password of the bucket to override authenticator.

Return Value

Bucket

See also

Authenticator

ClusterManager manager(string $username = null, string $password = null)

Open management connection to the Couchbase cluster.

Parameters

string $username

Name of the administrator to override authenticator or NULL.

string $password

Password of the administrator to override authenticator or NULL.

Return Value

ClusterManager

See also

Authenticator

null authenticate(Authenticator $authenticator)

Associate authenticator with Cluster

Parameters

Authenticator $authenticator

Return Value

null

See also

Authenticator
ClassicAuthenticator
PasswordAuthenticator

null authenticateAs(string $username, string $password)

Create \Couchbase\PasswordAuthenticator from given credentials and associate it with Cluster

Parameters

string $username
string $password

Return Value

null

See also

Authenticator
PasswordAuthenticator