Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00206b5

Browse filesBrowse files
[HttpClient] make HttpClient::create() return an AmpHttpClient when possible and curl is missing
1 parent f632b76 commit 00206b5
Copy full SHA for 00206b5

File tree

2 files changed

+4
-0
lines changed
Filter options

2 files changed

+4
-0
lines changed

‎src/Symfony/Component/HttpClient/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* added `NoPrivateNetworkHttpClient` decorator
88
* added `AmpHttpClient`, a portable HTTP/2 implementation based on Amp
99
* added `LoggerAwareInterface` to `ScopingHttpClient` and `TraceableHttpClient`
10+
* made `HttpClient::create()` return an `AmpHttpClient` when `amphp/http-client` is found but curl is not
1011

1112
4.4.0
1213
-----

‎src/Symfony/Component/HttpClient/HttpClient.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/HttpClient.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14+
use Amp\Http\Client\Connection\ConnectionLimitingPool;
1415
use Symfony\Contracts\HttpClient\HttpClientInterface;
1516

1617
/**
@@ -35,6 +36,8 @@ public static function create(array $defaultOptions = [], int $maxHostConnection
3536
}
3637

3738
@trigger_error('Configure the "curl.cainfo", "openssl.cafile" or "openssl.capath" php.ini setting to enable the CurlHttpClient', E_USER_WARNING);
39+
} elseif (class_exists(ConnectionLimitingPool::class)) {
40+
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
3841
}
3942

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.