Skip to content

Fix mongodb driver#443

Merged
Geolim4 merged 3 commits into
TruCopilot:finalfrom
jomisacu:final
Mar 19, 2017
Merged

Fix mongodb driver#443
Geolim4 merged 3 commits into
TruCopilot:finalfrom
jomisacu:final

Conversation

@jomisacu
Copy link
Copy Markdown
Contributor

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 the Driver::driverCheck method we can open the posibility to add support for the new mongodb library via an adapter like "alcaeus/mongo-php-adapter"

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"
{
/**
* @var MongodbClient
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the @Property annotation on the class ?
This has been added to few other drivers, you can take a look.

@Geolim4
Copy link
Copy Markdown
Member

Geolim4 commented Mar 19, 2017

I finally did it :D

@Geolim4 Geolim4 merged commit 78cae99 into TruCopilot:final Mar 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants