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

Breadcrumb

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

function FileDownloader::__construct

Constructor.

Parameters

IOInterface $io The IO instance:

Config $config The config:

HttpDownloader $httpDownloader The remote filesystem:

EventDispatcher $eventDispatcher The event dispatcher:

Cache $cache Cache instance:

Filesystem $filesystem The filesystem:

File

vendor/composer/composer/src/Composer/Downloader/FileDownloader.php, line 95

Class

FileDownloader
Base downloader for files

Namespace

Composer\Downloader

Code

public function __construct(IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $eventDispatcher = null, ?Cache $cache = null, ?Filesystem $filesystem = null, ?ProcessExecutor $process = null) {
    $this->io = $io;
    $this->config = $config;
    $this->eventDispatcher = $eventDispatcher;
    $this->httpDownloader = $httpDownloader;
    $this->cache = $cache;
    $this->process = $process ?? new ProcessExecutor($io);
    $this->filesystem = $filesystem ?? new Filesystem($this->process);
    if ($this->cache !== null && $this->cache
        ->gcIsNecessary()) {
        $this->io
            ->writeError('Running cache garbage collection', true, IOInterface::VERY_VERBOSE);
        $this->cache
            ->gc($config->get('cache-files-ttl'), $config->get('cache-files-maxsize'));
    }
}

API Navigation

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