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

Allow customizing URI options more #125

Open
bruno-buiret opened this issue Mar 8, 2023 · 2 comments
Open

Allow customizing URI options more #125

bruno-buiret opened this issue Mar 8, 2023 · 2 comments
Assignees

Comments

@bruno-buiret
Copy link
Contributor

Hello,

In order to better monitor ongoDB servers, I use the appName connection URI option but after going through the bundle's code, in particular ClientRegistry::buildClientConfiguration(), it seems like URI options can't be customized more than the four ones available here.

        return new ClientConfiguration(
            $conf['uri'],
            $conf['username'],
            $conf['password'],
            $conf['authSource'],
            // Beginning of URI options
            [
                'replicaSet' => $conf['replicaSet'],
                'ssl' => $conf['ssl'],
                'connectTimeoutMS' => $conf['connectTimeoutMS'],
                'readPreference' => $conf['readPreference'],
            ],
            // End of URI options
            $conf['driverOptions']
        );

Would it be possible to allow for more customization here? I'm not quite sure how to allow for more since these four ones are at the top level of the client's configuration and it would be quite a pain to add every possible URI option at top level.

Thanks!

@ilario-pierbattista
Copy link
Member

Hi @bruno-buiret thank you for opening this.

Not sure about implementation details, but yes I agree, it would be a pain keeping up with all possible uri options.

Maybe an approach similar to this #89 ?

@bruno-buiret
Copy link
Contributor Author

Hello,

You're welcome! It could be done with the same method I think, with an array_merge() of the four already existing ones if the UriOptionsInterface is defined?

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

No branches or pull requests

3 participants