Fix mongodb driver#443
Merged
Merged
Conversation
Fatal error: phpFastCache\Drivers\Mongodb\Driver and phpFastCache\Core\Pool\DriverBaseTrait define the same property ($instance) in the composition of phpFastCache\Drivers\Mongodb\Driver. However, the definition differs and is considered incompatible.
If we only verify that the MongoClient class exists then we can use adapters for the new Mongodb library. For example, "alcaeus/mongo-php-adapter"
Geolim4
requested changes
Mar 19, 2017
| { | ||
| /** | ||
| * @var MongodbClient | ||
| */ |
Member
There was a problem hiding this comment.
Can you please add the @Property annotation on the class ?
This has been added to few other drivers, you can take a look.
Geolim4
approved these changes
Mar 19, 2017
Member
|
I finally did it :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fatal error is triggered by inconsistency through "Driver" class and "DriverBaseTrait" trait. The $instance's access modifiers are different. The bug is fixed dropping $instance field from Driver class.
On the other hand, removing
class_exists('MongoDB\Driver\Manager)from theDriver::driverCheckmethod we can open the posibility to add support for the new mongodb library via an adapter like "alcaeus/mongo-php-adapter"