Skip to content

Commit

Permalink
minor #36137 [HttpClient] Issue notice when NativeHttpClient is used …
Browse files Browse the repository at this point in the history
…(trowski)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] Issue notice when NativeHttpClient is used

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

Commits
-------

874c1e6 [HttpClient] Issue notice when NativeHttpClient is used
  • Loading branch information
nicolas-grekas committed Mar 23, 2020
2 parents 0076ed5 + 874c1e6 commit 3afe198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpClient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static function create(array $defaultOptions = [], int $maxHostConnection
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
}

@trigger_error((\extension_loaded('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);

return new NativeHttpClient($defaultOptions, $maxHostConnections);
}

Expand Down

0 comments on commit 3afe198

Please sign in to comment.