8000 minor #36137 [HttpClient] Issue notice when NativeHttpClient is used … · symfony/symfony@3afe198 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3afe198

Browse files
minor #36137 [HttpClient] Issue notice when NativeHttpClient is used (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
2 parents 0076ed5 + 874c1e6 commit 3afe198

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/HttpClient/HttpClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public static function create(array $defaultOptions = [], int $maxHostConnection
6161
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
6262
}
6363

64+
@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);
65+
6466
return new NativeHttpClient($defaultOptions, $maxHostConnections);
6567
}
6668

0 commit comments

Comments
 (0)
0