Hi everybody, I’m glad to announce new release of PHP SDK.
This release contains bug fixes as well as new features. The minimum version of libcouchbase required is 2.7.4.
\Couchbase\N1qlQuery->adhoc()method actually worked in reversed way. When this parameter set to true (which is default), the library creates prepared statement, and skip it otherwise. Releases after 2.3.2 will fix this behaviour and really use adhoc queries by default.
PCBC-451: Add RBAC support in
\Couchbase\PasswordAuthenticatorclass (Couchbase Server 5.x feature). Read more about it in the blog Authentication and Authorization with RBAC.
$authenticator = new \Couchbase\PasswordAuthenticator(); $authenticator->username('john')->password('s3cret'); $cluster = new \Couchbase\Cluster('couchbase://127.0.0.1'); $cluster->authenticate($authenticator);
- PCBC-440: Add experimental support of extended attributes for subdocument operations. This might be useful for storing application-specific information, which should not be treated as document contents.
$b->upsert('doc1', ['foo' => 'bar']); $b->mutateIn('doc1') ->upsert('app.created_by', ['name' => 'John Doe', 'role' => 'DB administrator'], ['xattr' => true, 'createPath' => true]) ->execute(); $result = $b->lookupIn('doc1') ->get('app.created_by', ['xattr' => true, 'createPath' => true]) ->execute(); $result->value['value']; // ['name' => 'John Doe', 'role' => 'DB administrator']
PCBC-453: Verify that
ClusterManagersupports ephemeral buckets.
This is new type of buckets accessible in Couchbase Server 5, which basically enhanced Memcached-style bucket with replication, failover and other Couchbase bucket features.
$cluster = new \Couchbase\Cluster('couchbase://127.0.0.1'); $cluster->manager()->createBucket('ephemeralTest', ['bucketType' => 'ephemeral']);
- PCBC-473: Fix incorrect bucket reference copy in subdocument mutation/lookup builders, which might lead to segfault.
PCBC-474: Fix segfault when using
- PCBC-476: Do not call destructors on unintialized ZVALs. Fixes possible segfaults with view queries on PHP 5.x.
JsonSerializableinterface in run time, instead of compile time using
php_json_serializable_cesymbol. This fixes support of some 5.4-5.5 builds.
- PCBC-479: Do not allow to create objects in invalid state. For example Cluster might return an instance, and only show PHP warning on invalid arguments.
Bucket->counter()without specifying delta value results in null pointer dereference.
setRemovemethods of Bucket did not check if ‘get’ sub-request had thrown exception. This cause segfault, if operation executed on keys which do not exist.
Issue Tracker: https://issues.couchbase.com/projects/PCBC
Source code: https://github.com/couchbase/php-couchbase
Your feedback and contributions are always welcome!
Homebrew formula will be soon merged: https://github.com/Homebrew/homebrew-php/pull/4145
As well as PHPStorm stubs: https://github.com/JetBrains/phpstorm-stubs/pull/207