function FileDownloader::__construct
Constructor.
Parameters
IOInterface $io The IO instance:
Config $config The config:
HttpDownloader $httpDownloader The remote filesystem:
EventDispatcher $eventDispatcher The event dispatcher:
Filesystem $filesystem The filesystem:
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ FileDownloader.php, line 95
Class
- FileDownloader
- Base downloader for files
Namespace
Composer\DownloaderCode
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'));
}
}