Skip to content

FIX : Connection defaultDatabase #238

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

Open
wants to merge 14 commits into
base: v3.x
Choose a base branch
from

Conversation

RodrigoBLISS
Copy link

Connection was updating its internal property $defaultDatabase inside the method getClient().

Manager pulls the variable during setConnection(), with happens before connection->getClient() is called.

This cause the effect of not updating the defaultDatabase in time to be used on valid database exchanges. Causing the schema to always be called 'mongolid'.

This change updates the Connect->defaultDatabase during instantiation throught the __construct method. Updating the information in time to be pulled by Manager during setConnection.
Causing connection strings like this :
$manager->setConnection(new Connection('mongodb://192.168.1.202:27017/WGL'));

To work correctly using WGL as the schema name.

Please let me know if this PR is acceptable, or how can I correct it.

Best regards.

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.

3 participants