Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpDownloader.php

function HttpDownloader::__construct

Parameters

IOInterface $io The IO instance:

Config $config The config:

mixed[] $options The options:

File

vendor/composer/composer/src/Composer/Util/HttpDownloader.php, line 69

Class

HttpDownloader
@author Jordi Boggiano <j.boggiano@seld.be> @phpstan-type Request array{url: non-empty-string, options: mixed[], copyTo: string|null} @phpstan-type Job array{id: int, status: int, request: Request, sync: bool, origin: string, resolve?: callable,…

Namespace

Composer\Util

Code

public function __construct(IOInterface $io, Config $config, array $options = [], bool $disableTls = false) {
    $this->io = $io;
    $this->disabled = (bool) Platform::getEnv('COMPOSER_DISABLE_NETWORK');
    // Setup TLS options
    // The cafile option can be set via config.json
    if ($disableTls === false) {
        $this->options = StreamContextFactory::getTlsDefaults($options, $io);
    }
    // handle the other externally set options normally.
    $this->options = array_replace_recursive($this->options, $options);
    $this->config = $config;
    if (self::isCurlEnabled()) {
        $this->curl = new CurlDownloader($io, $config, $options, $disableTls);
    }
    $this->rfs = new RemoteFilesystem($io, $config, $options, $disableTls);
    if (is_numeric($maxJobs = Platform::getEnv('COMPOSER_MAX_PARALLEL_HTTP'))) {
        $this->maxJobs = max(1, min(50, (int) $maxJobs));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal