HAVE_IGBINARY
HAVE_IGBINARY
If igbinary extension was not found during build phase this constant will store 0
INI entries:
couchbase.log_level
(string), default: "WARN"
controls amount of information, the module will send to PHP error log. Accepts the following values in order of
increasing verbosity: "FATAL"
, "ERROR"
, "WARN"
, "INFO"
, "DEBUG"
, "TRACE"
.
couchbase.encoder.format
(string), default: "json"
selects serialization format for default encoder (\Couchbase\defaultEncoder). Accepts the following values:
"json"
- encodes objects and arrays as JSON object (using json_encode()
), primitives written in stringified form,
which is allowed for most of the JSON parsers as valid values. For empty arrays JSON array preferred, if it is
necessary, use new stdClass()
to persist empty JSON object. Note, that only JSON format considered supported by
all Couchbase SDKs, everything else is private implementation (i.e. "php"
format won't be readable by .NET SDK)."php"
- uses PHP serialize() method to encode the document."igbinary"
- uses pecl/igbinary to encode the document in even more efficient than "php"
format. Might not be
available, if the Couchbase PHP SDK didn't find it during build phase, in this case constant
\Couchbase\HAVE_IGBINARY will be false.couchbase.encoder.compression
(string), default: "none"
selects compression algorithm. Also see related compression options below. Accepts the following values:
"fastlz"
- uses FastLZ algorithm. The module might be configured to use system fastlz library during build,
othewise vendored version will be used. This algorithm is always available."zlib"
- uses compression implemented by libz. Might not be available, if the system didn't have libz headers
during build phase. In this case \Couchbase\HAVE_ZLIB will be false."off"
or "none"
- compression will be disabled, but the library will still read compressed values.couchbase.encoder.compression_threshold
(long), default: 0
controls minimum size of the document value in bytes to use compression. For example, if threshold 100 bytes, and the document size is 50, compression will be disabled for this particular document.
couchbase.encoder.compression_factor
(float), default: 0.0
controls the minimum ratio of the result value and original document value to proceed with persisting compressed bytes. For example, the original document consists of 100 bytes. In this case factor 1.0 will require compressor to yield values not larger than 100 bytes (100/1.0), and 1.5 -- not larger than 66 bytes (100/1.5).
couchbase.decoder.json_arrays
(boolean), default: false
controls the form of the documents, returned by the server if they were in JSON format. When true, it will generate arrays of arrays, otherwise instances of stdClass.
Authenticator | Interface of authentication containers. |
ViewQueryEncodable | Common interface for all View queries |
SearchQueryPart | Common interface for all classes, which could be used as a body of SearchQuery |
SearchFacet | Common interface for all search facets |
Exception | Exception represeting all errors generated by the extension |
Document | Represents Couchbase Document, which stores metadata and the value. |
DocumentFragment | A fragment of a JSON Document returned by the sub-document API. |
Cluster | Represents a Couchbase Server Cluster. |
ClusterManager | Provides management capabilities for a Couchbase Server Cluster |
UserSettings | Represents settings for new/updated user. |
Bucket | Represents connection to the Couchbase Server |
BucketManager | Provides management capabilities for the Couchbase Bucket |
ClassicAuthenticator | Authenticator based on login/password credentials. |
PasswordAuthenticator | Authenticator based on RBAC feature of Couchbase Server 5+. |
MutationToken | An object which contains meta information of the document needed to enforce query consistency. |
MutationState | Container for mutation tokens. |
ViewQuery | Represents regular Couchbase Map/Reduce View query |
SpatialViewQuery | Represents spatial Couchbase Map/Reduce View query |
N1qlQuery | Represents a N1QL query |
N1qlIndex | Represents N1QL index definition |
LookupInBuilder | A builder for subdocument lookups. In order to perform the final set of operations, use the execute() method. |
MutateInBuilder | A builder for subdocument mutations. In order to perform the final set of operations, use the execute() method. |
SearchQuery | Represents full text search query |
BooleanFieldSearchQuery | A FTS query that queries fields explicitly indexed as boolean. |
BooleanSearchQuery | A compound FTS query that allows various combinations of sub-queries. |
ConjunctionSearchQuery | A compound FTS query that performs a logical AND between all its sub-queries (conjunction). |
DisjunctionSearchQuery | A compound FTS query that performs a logical OR between all its sub-queries (disjunction). It requires that a minimum of the queries match. The minimum is configurable (default 1). |
DateRangeSearchQuery | A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured. |
NumericRangeSearchQuery | A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured. |
DocIdSearchQuery | A FTS query that matches on Couchbase document IDs. Useful to restrict the search space to a list of keys (by using this in a compound query). |
MatchAllSearchQuery | A FTS query that matches all indexed documents (usually for debugging purposes). |
MatchNoneSearchQuery | A FTS query that matches 0 document (usually for debugging purposes). |
MatchPhraseSearchQuery | A FTS query that matches several given terms (a "phrase"), applying further processing like analyzers to them. |
MatchSearchQuery | A FTS query that matches a given term, applying further processing to it like analyzers, stemming and even #fuzziness(int). |
PhraseSearchQuery | A FTS query that matches several terms (a "phrase") as is. The order of the terms mater and no further processing is applied to them, so they must appear in the index exactly as provided. Usually for debugging purposes, prefer MatchPhraseQuery. |
RegexpSearchQuery | A FTS query that allows for simple matching of regular expressions. |
WildcardSearchQuery | A FTS query that allows for simple matching using wildcard characters (* and ?). |
PrefixSearchQuery | A FTS query that allows for simple matching on a given prefix. |
QueryStringSearchQuery | A FTS query that performs a search according to the "string query" syntax. |
TermSearchQuery | A facet that gives the number of occurrences of the most recurring terms in all hits. |
TermRangeSearchQuery | A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured. |
GeoDistanceSearchQuery | A FTS query that finds all matches from a given location (point) within the given distance. |
GeoBoundingBoxSearchQuery | A FTS query which allows to match geo bounding boxes. |
TermSearchFacet | A facet that gives the number of occurrences of the most recurring terms in all hits. |
DateRangeSearchFacet | A facet that categorizes hits inside date ranges (or buckets) provided by the user. |
NumericRangeSearchFacet | A facet that categorizes hits into numerical ranges (or buckets) provided by the user. |
AnalyticsQuery | Represents a Analytics query (currently experimental support). |
passthruDecoder(string $bytes, integer $flags, integer $datatype) : string
Returns value as it received from the server without any transformations.
It is useful for debug purpose to inspect bare value.
string | $bytes | |
integer | $flags | |
integer | $datatype |
Document as it received from the Couchbase.
<?php $cluster = new \Couchbase\Cluster("couchbase://localhost"); $bucket = $cluster->openBucket("default"); $bucket->setTranscoder("\\Couchbase\\defaultEncoder", "\\Couchbase\\passthruDecoder"); $bucket->upsert("foo", ["bar" => "baz"]); $value = $bucket->get("foo")->value; var_dump($value); // => string(13) "{"bar":"baz"}"
passthruEncoder(string $value) : array
Returns the value, which has been passed and zero as flags and datatype.
It is useful for debug purposes, or when the value known to be a string, otherwise behavior is not defined (most likely it will generate error).
string | $value | document to be stored in the Couchbase |
Array with three values: [bytes, 0, 0]
defaultDecoder(string $bytes, integer $flags, integer $datatype) : mixed
Decodes value using \Couchbase\basicDecoderV1.
It passes couchbase.decoder.*
INI properties as $options.
string | $bytes | Binary string received from the Couchbase, which contains encoded document |
integer | $flags | Flags which describes document encoding |
integer | $datatype | Extra field for datatype (not used at the moment) |
Decoded document object
basicDecoderV1(string $bytes, integer $flags, integer $datatype, array $options) : mixed
Decodes value according to Common Flags (RFC-20)
string | $bytes | Binary string received from the Couchbase, which contains encoded document |
integer | $flags | Flags which describes document encoding |
integer | $datatype | Extra field for datatype (not used at the moment) |
array | $options |
Decoded document object
basicEncoderV1(mixed $value, array $options) : array
Encodes value according to Common Flags (RFC-20)
mixed | $value | document to be stored in the Couchbase |
array | $options | Encoder options (see detailed description in INI section)
|
Array with three values: [bytes, flags, datatype]