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 |
sagikazarmark
left a comment
There was a problem hiding this comment.
Actually, after a closer look: this PR is not compatible with PHP 5.x
| */ | ||
| class CurlFactory implements CurlFactoryInterface | ||
| { | ||
| private const CURL_VERSION_STR = 'curl_version'; |
There was a problem hiding this comment.
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.
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?
lower version curl wouldn't tell uri in error message.