Undefined class ClusterOptions

Following the instructions for installing the 3.1 driver, I only get code completion and stubs for the 2.3 version of the driver via my IDE (PHPStorm), despite the 3.1 driver being loaded correctly.

I cannot get PHPStorm to utilize the types from the 3.1 SDK

Hello @Robert_Mirabelle I am assuming your older version was 2.3 ? Can you do a clean install i.e uninstall the older version of PHP SDK and Installing the latest. I am thinking that 2.3 is cached somewhere.

@avsej any thoughts ?

First version I installed was 2.6. I never installed 2.3 at all. There appear to be only a couple of files that constitute the extension e.g. php_couchbase.dll and libcouchbase.dll, presumably where the types I need can be found. I’ve re-copied and restarted Apache many times. PHPStorm appears to recognize the extension is installed, but parse only old 2.3 types from it.

Make sure your PhpStorm loads proper stubs. This is where they keep them online: phpstorm-stubs/couchbase_v3 at master · JetBrains/phpstorm-stubs · GitHub

1 Like

So, if I have to manually download and place the stubs (because they are not included with the Composer library and PHPStorm incorrectly parses old 2.3 types from the .dll), can I expect the PHP SDK 3.1 documentation to be updated to reflect this? If you can’t use the 3.1 SDK in the world’s most popular PHP IDE without having to perform this additional step, then I would argue it’s critically important to clearly indicate this in the documentation.

I totally understand your point. But we are not maintaining stubs in PhpStorm, and I asked then to name new stubs as couchbase while renaming older to couchbase_v2, but unfortunately they decided to rather name new stubs as couchbase_v3. Maybe if more users will ask for it, it will be possible to consider them to rename stubs so that by default IDE will use recent stubs.

I don’t have versioning problems with any other library or stubs in PHPStorm other than couchbase, so I’m not sure if asking your users to contact JetBrains is the right policy. But my original question still stands: Can we expect the PHP SDK documentation to be updated to reflect that obtaining the correct stubs is necessary for proper installation and usage of the SDK? After all, without the correct stubs, the SDK is pretty much useless.

Thanks again.

@Robert_Mirabelle thanks for the feedback, a documentation issue has been created to address this.

1 Like