mongodb-bundle icon indicating copy to clipboard operation
mongodb-bundle copied to clipboard

Allow customizing URI options more

Open scibiliad opened this issue 2 years ago • 5 comments

This PR resolve the issue https://github.com/facile-it/mongodb-bundle/issues/125

scibiliad avatar May 10 '23 09:05 scibiliad

Hi, sorry, but do you have time to finish the pull request? Thank you so much

bruno-buiret avatar Oct 10 '24 12:10 bruno-buiret

Hi, I'll try to complete it in the next few weeks

scibiliad avatar Oct 13 '24 10:10 scibiliad

Thank you so much!

bruno-buiret avatar Oct 14 '24 07:10 bruno-buiret

Hey @bruno-buiret, thank you for opening the issue, we're almost there.

Before merging this, would you give use some feedback? Does this satisfy all your needs?

You can install it with:

composer require facile-it/mongodb-bundle:dev-allow_customizing_URI_options_more

The branch is rebased on 1.6.2 so that everything is up to date.

Thank you in advance

ilario-pierbattista avatar Dec 07 '24 07:12 ilario-pierbattista

@ilario-pierbattista, so sorry, work has been kind of hectic.

I just created a basic Symfony 7.2 application with PHP 8.4 and added the bundle with the Composer command you provided. I was able to customize the appname parameter and it showed in $currentOp, so thanks!

A few questions if I may,

  1. Would it be possible to have the client's name as a second parameter so that logic can be different according to the client being built?
interface UriOptionsInterface
{
    /**
     * ...
     */
    public function buildUriOptions(array $clientConfiguration, string $clientName): array;
}
  1. Is it normal that for DriverOptionsInterface the full $conf is used as a parameter instead of only $conf['driverOptions'] in \Facile\MongoDbBundle\Services\ClientRegistry::buildClientConfiguration()?
        $conf['driverOptions'] = [];
        if ($this->driverOptionsService instanceof DriverOptionsInterface) {
            $conf['driverOptions'] = $this->driverOptionsService->buildDriverOptions($conf);
        }
  1. If it's possible to add the client's name for UriOptionsInterface, it would be quite cool to have it for DriverOptionsInterface too ^^

Thank you so much for this and I hope this help!

bruno-buiret avatar Dec 16 '24 18:12 bruno-buiret