8000 [HttpClient] Issue notice when NativeHttpClient is used by trowski · Pull Request #36137 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Issue notice when NativeHttpClient is used #36137

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

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

trowski
Copy link
Contributor
@trowski trowski commented Mar 19, 2020
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

Simple PR to issue a notice to notify the user that ext-curl or amphp/http-client should be installed to use an HTTP/2 capable HTTP client. Not sure on the notice wording.

@trowski trowski force-pushed the native-client-notice branch from f887975 to 720501c Compare March 19, 2020 21:27
@@ -61,6 +61,8 @@ public static function create(array $defaultOptions = [], int $maxHostConnection
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
}

@trigger_error(($curl ? 'Upgrade' : 'Install').' the curl extension or run "composer require amphp/http-client" to perform async HTTP operations, including full HTTP/2 support', E_USER_NOTICE);
Copy link
Member

Choose a reason for hiding this comment

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

instead of using a variable, I would put \extension_loaded('curl') inline again. That function call is resolved at compile-time by OPCache, but the variable value is not.

@nicolas-grekas
Copy link
Member

Thank you @trowski.

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

Successfully merging this pull request may close these issues.

5 participants
0