Skip to content

curl error msg for low version#2108

Merged
sagikazarmark merged 4 commits intoguzzle:masterfrom
wwulfric:master
Apr 15, 2019
Merged

curl error msg for low version#2108
sagikazarmark merged 4 commits intoguzzle:masterfrom
wwulfric:master

Conversation

@wwulfric
Copy link
Copy Markdown

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

@sagikazarmark
Copy link
Copy Markdown
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
Copy Markdown
Author

wwulfric commented Aug 3, 2018

@sagikazarmark Solved

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread src/Handler/CurlFactory.php Outdated
*/
class CurlFactory implements CurlFactoryInterface
{
private const CURL_VERSION_STR = 'curl_version';
Copy link
Copy Markdown
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
Copy Markdown
Member

Thanks @wwulfric

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

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
Copy Markdown
Contributor

@guilliamxavier guilliamxavier Apr 8, 2020

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
Copy Markdown
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.

4 participants