function CurlDownloader::__construct
Parameters
mixed[] $options:
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Http/ CurlDownloader.php, line 95
Class
- CurlDownloader
- @internal @author Jordi Boggiano <j.boggiano@seld.be> @author Nicolas Grekas <p@tchwork.com> @phpstan-type Attributes array{retryAuthFailure: bool, redirects: int<0, max>, retries: int<0, max>, storeAuth:…
Namespace
Composer\Util\HttpCode
public function __construct(IOInterface $io, Config $config, array $options = [], bool $disableTls = false) {
$this->io = $io;
$this->config = $config;
$this->multiHandle = $mh = curl_multi_init();
if (function_exists('curl_multi_setopt')) {
curl_multi_setopt($mh, CURLMOPT_PIPELINING, \PHP_VERSION_ID >= 70400 ? 2 : 3);
if (defined('CURLMOPT_MAX_HOST_CONNECTIONS') && !defined('HHVM_VERSION')) {
curl_multi_setopt($mh, CURLMOPT_MAX_HOST_CONNECTIONS, 8);
}
}
if (function_exists('curl_share_init')) {
$this->shareHandle = $sh = curl_share_init();
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
}
$this->authHelper = new AuthHelper($io, $config);
}