How to disconnect a couchbase connection in PHP explicitly?

Hi Team,

I want to disconnect my couchbase connection explicitly in PHP client. As forum suggest, I tried to disconnect my bucket using the following code


But ending with an error message as follow

Fatal error: Call to undefined method CouchbaseCluster::disconnect() in ** on line **

Someone please assist me how to achieve this.
Currently I’m using Couchbase server 4.0 and PHP SDK 2.0/2.1

Hi @Chi, it seems like documentation have to be fixed. At the moment, there is no way explicitly close connection.

The library automatically close all connections when the PHP extension is being unloaded, or there is an error registered by the end of request. Otherwise the connection considered live and will be reused for further requests.

FYI guys, the documentation still has not been updated. It still states you can disconnect from the cluster. This should be resolved. Seems trivial to fix.

Thank you.

PS. Would be nice to explicitly cut the connection.