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 to pass DSN to the Elastica\Client constructor #1640

Closed
renanbr opened this issue Jun 14, 2019 · 3 comments
Closed

Allow to pass DSN to the Elastica\Client constructor #1640

renanbr opened this issue Jun 14, 2019 · 3 comments

Comments

@renanbr
Copy link
Contributor

renanbr commented Jun 14, 2019

Currently I have to handle config options as separated keys in each environment my application is deployed (local, ci, staging, prod...). Things become hard when an environment required an option the other don't...

It could be cool if Elastica\Client's constructor becomes able to parse a single string.

new Elastica\Client('192.168.1.1:9200');
new Elastica\Client('https://user:p4ss@foo.com:9200/elastic;persistent=false;retryOnConflict=2');
@tacman
Copy link

tacman commented Jul 16, 2019

Yes, this would be particular helpful on deployments like Heroku, which creates the DSN environment variable when the service is created, but configuring it requires manually breaking it apart into the individual components.

@ruflin
Copy link
Owner

ruflin commented Aug 12, 2019

Do you see a way how we could introduce this without making it a breaking change? In general, +1 on having such a feature.

alamirault added a commit to alamirault/Elastica that referenced this issue Aug 17, 2019
alamirault added a commit to alamirault/Elastica that referenced this issue Aug 25, 2019
alamirault added a commit to alamirault/Elastica that referenced this issue Aug 25, 2019
ruflin pushed a commit that referenced this issue Aug 28, 2019
This PR allow to pass DSN to the Elastica\Client constructor as discussed in #1640 .

For example: $client = new Client('https://user:p4ss@foo.com:9200?persistent=false&retryOnConflict=2');
@alamirault
Copy link
Contributor

PR is now merge, I think @ruflin you can close issue.

@ruflin ruflin closed this as completed Sep 24, 2019
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

4 participants