static $curlVersion = null;
$curlVersion ??=
curl_version();
// HTTP/2 push crashes before curl 7.61
if (0x073D00 >
$curlVersion['version_number'
] || !
(\CURL_VERSION_HTTP2 &
$curlVersion['features'
])) { return new AmpHttpClient($defaultOptions, null,
$maxHostConnections,
$maxPendingPushes);
} } if (\
extension_loaded('curl'
)) { if ('\\' !== \DIRECTORY_SEPARATOR ||
isset($defaultOptions['cafile'
]) ||
isset($defaultOptions['capath'
]) || \
ini_get('curl.cainfo'
) || \
ini_get('openssl.cafile'
) || \
ini_get('openssl.capath'
)) { return new CurlHttpClient($defaultOptions,
$maxHostConnections,
$maxPendingPushes);
} @
trigger_error('Configure the "curl.cainfo", "openssl.cafile" or "openssl.capath" php.ini setting to enable the CurlHttpClient', \E_USER_WARNING
);
} if ($amp) { return new AmpHttpClient($defaultOptions, null,
$maxHostConnections,
$maxPendingPushes);
} @
trigger_error((\
extension_loaded('curl'
) ? 'Upgrade' : 'Install'
).' the curl extension or run "composer require amphp/http-client:^4.2.1" to perform async HTTP operations, including full HTTP/2 support', \E_USER_NOTICE
);