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

Support DSN configuration style for Elastica client #112

Open
Tristan971 opened this issue Aug 29, 2022 · 2 comments
Open

Support DSN configuration style for Elastica client #112

Tristan971 opened this issue Aug 29, 2022 · 2 comments

Comments

@Tristan971
Copy link

In Elastically's client's constructor, initialisation of the factory is triggered in the following line:

// BC Layer, to remove in 2.0
$this->factory = new Factory($config);

This causes Elastically to require an array-style configuration for Elastica, even Elastica supports DSN-style configuration. This causes an issue when trying to use a DSN:

In Factory.php line 53:
                                                                                                                                            
  JoliCode\Elastically\Factory::__construct(): Argument #1 ($config) must be of type array, string given, called in .../vendor/jolicode/elastically/src/Client.php on line 38                                                                                
                                                                                                                                            

It would probably look nicer in general to have the Elastica client instance split away from the Elastically one

@lyrixx
Copy link
Member

lyrixx commented Aug 29, 2022

I like it. Would you mind to submit a PR?

@Tristan971
Copy link
Author

I can sketch something out in the next few days and see if it looks good

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

2 participants