Cluster
in package
implements
ClusterInterface
Cluster is an object containing functionality for performing cluster level operations against a cluster and for access to buckets.
Tags
Interfaces, Classes, Traits and Enums
Table of Contents
- $connectionHash : string
- $core : resource
- $options : ClusterOptions
- __construct() : mixed
- analyticsIndexes() : AnalyticsIndexManager
- Creates a new manager object for managing analytics query indexes.
- analyticsQuery() : AnalyticsResult
- Executes an analytics query against the cluster.
- bucket() : Bucket
- Returns a new bucket object.
- buckets() : BucketManager
- Creates a new bucket manager object for managing buckets.
- connect() : ClusterInterface
- diagnostics() : mixed
- Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.
- notifyFork() : void
- Notifies the SDK about usage of `fork(2)` syscall. Typically PHP exposes it using `pcntl_fork()` function, but the library should have chance to properly close descriptors and reach safe point to allow forking the process.
- ping() : mixed
- Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.
- query() : QueryResult
- Executes a N1QL query against the cluster.
- queryIndexes() : QueryIndexManager
- Creates a new manager object for managing N1QL query indexes.
- search() : SearchResult
- Executes a search query against the full text search services.
- searchIndexes() : SearchIndexManager
- Creates a new search index manager object for managing search query indexes.
- searchQuery() : SearchResult
- Executes a full text search query against the cluster.
- transactions() : Transactions
- Creates a new bucket manager object for managing buckets.
- users() : UserManager
- Creates a new user manager object for managing users and groups.
- enableProtostellar() : void
Properties
$connectionHash
private
string
$connectionHash
$core
private
resource
$core
$options
private
ClusterOptions
$options
Methods
__construct()
public
__construct(string $connectionString, ClusterOptions $options) : mixed
Parameters
- $connectionString : string
- $options : ClusterOptions
Tags
Return values
mixed —analyticsIndexes()
Creates a new manager object for managing analytics query indexes.
public
analyticsIndexes() : AnalyticsIndexManager
Tags
Return values
AnalyticsIndexManager —analyticsQuery()
Executes an analytics query against the cluster.
public
analyticsQuery(string $statement[, AnalyticsOptions|null $options = null ]) : AnalyticsResult
Note: On Couchbase Server versions < 6.5 a bucket must be opened before using analyticsQuery.
Parameters
- $statement : string
-
the analytics query statement to execute
- $options : AnalyticsOptions|null = null
-
the options to use when executing the query
Tags
Return values
AnalyticsResult —bucket()
Returns a new bucket object.
public
bucket(string $name) : Bucket
Parameters
- $name : string
-
the name of the bucket
Tags
Return values
Bucket —buckets()
Creates a new bucket manager object for managing buckets.
public
buckets() : BucketManager
Tags
Return values
BucketManager —connect()
public
static connect(string $connectionString, ClusterOptions $options) : ClusterInterface
Parameters
- $connectionString : string
- $options : ClusterOptions
Tags
Return values
ClusterInterface —diagnostics()
Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.
public
diagnostics([string|null $reportId = null ]) : mixed
Parameters
- $reportId : string|null = null
-
a name which will be included within the ping result
Tags
Return values
mixed —notifyFork()
Notifies the SDK about usage of `fork(2)` syscall. Typically PHP exposes it using `pcntl_fork()` function, but the library should have chance to properly close descriptors and reach safe point to allow forking the process.
public
static notifyFork(string $event) : void
This is not a problem in case of proc_open()
as in this case the memory and descriptors are not inherited by
the child process.
Allowed values for $event
are:
- ForkEvent::PREPARE - must be used before
fork()
to ensure the SDK reaches safe point - ForkEvent::CHILD - must be used in the child process, the branch where
pcntl_fork()
returns zero - ForkEvent::PARENT - must be used in the parent process, the branch where
pcntl_fork()
returns pid of the child process
In case pcntl_fork()
returns negative value, and the application decides to continue, notifyFork(ForkEvent::PARENT)
must be invoked to resume the SDK.
Parameters
- $event : string
-
type of the event to send to the library (one of the constants in ForkEvent).
Tags
Return values
void —ping()
Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.
public
ping([mixed|null $services = null ][, mixed|null $reportId = null ]) : mixed
Parameters
- $services : mixed|null = null
-
the services to ping against
- $reportId : mixed|null = null
-
a name which will be included within the ping result
Tags
Return values
mixed —query()
Executes a N1QL query against the cluster.
public
query(string $statement[, QueryOptions|null $options = null ]) : QueryResult
Note: On Couchbase Server versions < 6.5 a bucket must be opened before using query.
Parameters
- $statement : string
-
the N1QL query statement to execute
- $options : QueryOptions|null = null
-
the options to use when executing the query
Tags
Return values
QueryResult —queryIndexes()
Creates a new manager object for managing N1QL query indexes.
public
queryIndexes() : QueryIndexManager
Tags
Return values
QueryIndexManager —search()
Executes a search query against the full text search services.
public
search(string $indexName, SearchRequest $request[, SearchOptions|null $options = null ]) : SearchResult
This can be used to perform a traditional FTS query, and/or a vector search.
Parameters
- $indexName : string
-
the cluster-level FTS index to use for the search request
- $request : SearchRequest
-
The search request to run
- $options : SearchOptions|null = null
-
The options to use when executing the search request
Tags
Return values
SearchResult —searchIndexes()
Creates a new search index manager object for managing search query indexes.
public
searchIndexes() : SearchIndexManager
Return values
SearchIndexManager —searchQuery()
Executes a full text search query against the cluster.
public
searchQuery(string $indexName, SearchQuery $query[, SearchOptions|null $options = null ]) : SearchResult
Note: On Couchbase Server versions < 6.5 a bucket must be opened before using searchQuery.
Parameters
- $indexName : string
-
the fts index to use for the query
- $query : SearchQuery
-
the search query to execute
- $options : SearchOptions|null = null
-
the options to use when executing the query
Tags
Return values
SearchResult —transactions()
Creates a new bucket manager object for managing buckets.
public
transactions([TransactionsConfiguration|null $config = null ]) : Transactions
Parameters
- $config : TransactionsConfiguration|null = null
Tags
Return values
Transactions —users()
Creates a new user manager object for managing users and groups.
public
users() : UserManager
Tags
Return values
UserManager —enableProtostellar()
private
static enableProtostellar() : void