We are finally upgrading our Couchbase SDK to the latest.
I used to get the bucket name from CouchbaseBucket by using reflection since $bucket->manager()->info() was not stable for some reason and it makes network request as far as I understand.
There is no public API to get the name of the bucket, but as soon as it is not possible to change it for the bucket object, you can keep then in associative array where the name of the bucket would be the key.
In your example, why don’t you just initialize bucketName at the step where you open the bucket?
I really have no idea why a public API gets removed in a minor version update.
We are not using a framework specific library.
I can easily pass a new string value along with CouchbaseBucket object, but that just does not look right. It also requires a code change. It’s almost like passing a Person object with name variable in it, but then passing another string value for the name to a class. It’s simply unnecessary and error prone.