Skip to content
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

Move MongoDB config under "mongodb" subkey #382

Merged
merged 7 commits into from
Dec 17, 2020
Merged

Move MongoDB config under "mongodb" subkey #382

merged 7 commits into from
Dec 17, 2020

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Dec 15, 2020

New mongodb config keys:

    'mongodb' => [
        // 'hostname' and 'port' are used to build DSN for MongoClient
        'hostname' => getenv('XHGUI_MONGO_HOSTNAME') ?: '127.0.0.1',
        'port' => getenv('XHGUI_MONGO_PORT') ?: 27017,
        // The database name
        'database' => getenv('XHGUI_MONGO_DATABASE') ?: 'xhprof',
        // Additional options for the MongoClient constructor,
        // for example 'username', 'password', or 'replicaSet'.
        // See <https://www.php.net/mongoclient_construct#options>.
        'options' => [],
        // An array of options for the MongoDB driver.
        // Options include setting connection context options for SSL or logging callbacks.
        // See <https://www.php.net/mongoclient_construct#options>.
        'driverOptions' => [],
    ],

Support for previous keys remains for undefined future.

Fixes #267

@glensc glensc self-assigned this Dec 15, 2020
@glensc glensc added this to the Next milestone Dec 15, 2020
@glensc glensc force-pushed the config-sanity branch 2 times, most recently from 2b56ac5 to c9fe314 Compare December 15, 2020 16:12
This cleans up some duplication and un-needed 'mongo.database' key
Easier to follow flow when methods are short and do single thing
Note: the database name is just set, instead of merged to avoid FrozenServiceException

> Cannot override frozen service "mongodb.database"
@glensc glensc merged commit b1d8e23 into master Dec 17, 2020
@glensc glensc deleted the config-sanity branch December 17, 2020 14:15
@glensc glensc mentioned this pull request Apr 15, 2021
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.

database part of mongodb url is not handled
1 participant