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

curl error msg for low version #2108

Merged
merged 4 commits into from Apr 15, 2019
Merged

curl error msg for low version #2108

merged 4 commits into from Apr 15, 2019

Conversation

wwulfric
Copy link

lower version curl wouldn't tell uri in error message.

@sagikazarmark
Copy link
Member

Newer versions does, so this solution sort of duplicates the uri in the error message? Maybe format the message according to the curl version?

@wwulfric
Copy link
Author

wwulfric commented Aug 3, 2018

@sagikazarmark Solved

Copy link
Member

@sagikazarmark sagikazarmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @wwulfric

Copy link
Member

@sagikazarmark sagikazarmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, after a closer look: this PR is not compatible with PHP 5.x

@@ -14,6 +14,8 @@
*/
class CurlFactory implements CurlFactoryInterface
{
private const CURL_VERSION_STR = 'curl_version';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant visibility is not supported on PHP 5.x

@sagikazarmark
Copy link
Member

Thanks @wwulfric

@sagikazarmark sagikazarmark merged commit 3d499a1 into guzzle:master Apr 15, 2019
@wirwolf
Copy link

wirwolf commented Oct 18, 2019

Hello @wwulfric, i create a fork of this repo and release this marge request into the new version(6.4.0).

Namespace compatibility is 100%, and you can use my changes if you patch composer.json in your projects

  • replace "guzzlehttp/guzzle": "^6.3" to "someblackmagic/guzzle": "^6.4"
  • add "guzzlehttp/guzzle": "6.3.*" into replace block

Fork link: https://github.com/SomeBlackMagic/guzzle/

$ctx['error'],
'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
);
if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be late but this seems wrong, it's missing a comparison operator (either against 0 or as a third string argument, see examples). Currently it's basically testing curl_version()['version'] != '7.21.2'. I guess you intended > here? But actually I couldn't find any evidence that curl 7.21.2+ added the URI in the error message... Could you please explain your scenario?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proposed #2648

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

Successfully merging this pull request may close these issues.

None yet

4 participants