Details
-
Task
-
Resolution: Fixed
-
Major
-
2.3.1
-
None
-
None
-
PHP 7.1
Description
Invoking bucket->counter('customer::counter') results in PHP shutting down and reporting "segmentation fault: 11" to the command line.
$app->post('/api/customer', function($request, $response, $args) {
$jsonDocType = $request->getAttribute('jsonDocType');
$jsonBody = $request->getParsedBody();
// $docId = $jsonDocType . '::' . $jsonBody['username']; // . uniqid();
$increment = $this->bucket->counter('customer::counter');
var_dump($increment); die();
});
Invoking either bucket->counter('customer::counter', 1) or bucket->counter('customer::counter', 1, ['1']) results in LCB_KEY_ENOENT: The key does not exist on the server.
In our other SDKs, the first use of bucket.counter() causes the counter document to be created if it does not already exist, with a default value of 1 and a default increment of 1.
$app->post('/api/customer', function($request, $response, $args) {
$jsonDocType = $request->getAttribute('jsonDocType');
$jsonBody = $request->getParsedBody();
// $docId = $jsonDocType . '::' . $jsonBody['username']; // . uniqid();
// $increment = $this->bucket->counter('customer::counter', 1, ['1']);
* *$increment = $this->bucket->counter('customer::counter', 1);**
var_dump($increment); die();
});