-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Where is the Driver namespace? #55
Comments
I'm not sure what you mean. What exactly isn't defined? Can you paste the exact error message? I suspect maybe you didn't install the driver itself properly, try:
|
You also need to remove the old mongo extension for it to work properly. |
That should not be necessary as both extensions occupy different namespaces (top-level for legacy and |
I had some problems with BSON and Driver namespaces. My IDE (PhpStorm) says that those namespaces are undefined. MongoDb extension definetly is being loaded by PHP interpreter theIDE uses. I don't have old mongo anywhere in the system and don't have any links to old mongo anywhere in the configs or libraries. I have installed mongodb via pecl. - But the problem was in the IDE itself - it uses only official libraries for syntaxis analysis. So it highlights namespaces as undefined even though the code itself works. may be @beyazkurt has the same issue. |
The same problem and for me. IDE says that namespaces are undefined. I have installed driver by pecl as in described in instructions. IDE is PHPStorm. |
I thought the same, but the classes would not be available until i disabled the old extension.
The current version of PHPStorm doesn't include the stubs for the new extension yet. You can add the stub file to your project though to get the autocomplete until it officially arrives in an update. Get it from here: https://raw.githubusercontent.com/JetBrains/phpstorm-stubs/master/mongodb.php |
IDE stubs are currently being left to the community and IDE authors, so I'm going to close this out. Note that the extension does have reflection info defined to assist with stub generation. Any discrepancies between that info and reality (or PHP.net docs) are definitely a bug that we'll gladly look into. We've had a few reports already, which were fixed and should appear in any recently generated stubs. |
I have installed this package from composer and despite the use of Driver namespace it's not defined.
The text was updated successfully, but these errors were encountered: