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

Use Guzzle instead of cURL? #9

Open
danielmarschall opened this issue Apr 2, 2023 · 2 comments
Open

Use Guzzle instead of cURL? #9

danielmarschall opened this issue Apr 2, 2023 · 2 comments
Labels
idea Ideas

Comments

@danielmarschall
Copy link
Owner

https://docs.guzzlephp.org/en/stable/overview.html

Pro:

  • We can remove dependency to cURL

Contra

  • Requires PHP 7.2.5, but we want to stay compatible with PHP 7.0 for now
@danielmarschall
Copy link
Owner Author

In the current version, all calls to CURL have been put into the function url_post_contents() which acts the same ways as url_get_contents(). The method url_post_contents_available() helps finding out if POST can be used, i.e. CURL is installed.

If we'd use Guzzle, we just need to change url_post_contents() now

@wehowski
Copy link
Collaborator

wehowski commented Aug 17, 2023

Hello Daniel,
just one idea:
guzzle implements the PSR-18 Interfaces.
Why not do the same with a PSR-18 OIDplus Guzzle/Curl Wrapper.
Global functions like url_post_contents are ok too, but your Http-Client class maybe would be useable in other applications too if you use/implement (agnostic) interfaces.

If you implement PSR specs everywhere possible and reasonable, you can be quite sure that to change one successor should be easy.

Another thing you can try is to use PHP-Version switches in installing/composer.
One approach to do so (but be carefull and test it its dirty!) is to just require
"guzzlehttp/guzzle" : "*"
instead of specifying a version composer automatically takes the best compatible one regarding minimum-stabillity and etc...
( But for guzzle the php 7.0 version then would be https://packagist.org/packages/guzzlehttp/guzzle#6.5.x-dev ? )

Viele Grüße
Till

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Ideas
Projects
None yet
Development

No branches or pull requests

2 participants