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

Breadcrumb

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

function FileDownloader::processUrl

Process the download url

Parameters

PackageInterface $package package instance:

non-empty-string $url download url:

Return value

non-empty-string url

Throws

\RuntimeException If any problem with the url

2 calls to FileDownloader::processUrl()
FileDownloader::download in vendor/composer/composer/src/Composer/Downloader/FileDownloader.php
@inheritDoc
ZipDownloader::extractWithSystemUnzip in vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php
extract $file to $path with "unzip" command

File

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

Class

FileDownloader
Base downloader for files

Namespace

Composer\Downloader

Code

protected function processUrl(PackageInterface $package, string $url) : string {
    if (!extension_loaded('openssl') && 0 === strpos($url, 'https:')) {
        throw new \RuntimeException('You must enable the openssl extension to download files via https');
    }
    if ($package->getDistReference() !== null) {
        $url = UrlUtil::updateDistReference($this->config, $url, $package->getDistReference());
    }
    return $url;
}

API Navigation

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