Description
BOTH JSON objects AND JSON arrays are decoded by the SDK 3.1 into PHP arrays when fetching/decoding documents. For example, for this document:
"address": { |
"address1": null, |
"city": null, |
"county": null, |
"state": null, |
"zip": null |
},
|
I expect address to be fetched/decoded into a PHP stdClass instance, but instead, it is incorrectly decoded into a PHP array:
[address] => Array <-- wrong, should be stdClass
|
(
|
[address1] =>
|
[city] =>
|
[county] =>
|
[state] => FL
|
[zip] =>
|
)
|
This makes the SDK effectively useless, as it's critically important that I distinguish between objects and arrays in returned results.
Documentation loosely mentions a php.ini configuration setting:
couchbase.decoder.json_arrays = 0 |
But this setting has no effect. It appears to be completely ignored by the SDK. It also appears to default to true instead of false.
We're instructed to set the value to false to decode JSON objects into stdClass instances, but if I use false instead of 0, the setting isn't even read by php.ini. When using 0, the setting is read by php.ini, but still completely ignored.
Until this issue is resolved, I'll be forced to roll back to PHP SDK v2.x. This is unfortunate, because v3 introduced a host of breaking changes that required rewriting a bunch of middleware in my app.
Help!