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
Conversation
Newer versions does, so this solution sort of duplicates the uri in the error message? Maybe format the message according to the curl version? |
@sagikazarmark Solved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @wwulfric
There was a problem hiding this 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
src/Handler/CurlFactory.php
Outdated
@@ -14,6 +14,8 @@ | |||
*/ | |||
class CurlFactory implements CurlFactoryInterface | |||
{ | |||
private const CURL_VERSION_STR = 'curl_version'; |
There was a problem hiding this comment.
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
Thanks @wwulfric |
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
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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proposed #2648
lower version curl wouldn't tell uri in error message.