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

Breadcrumb

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

function VcsDownloader::prepareUrls

Parameters

string[] $urls:

Return value

string[]

3 calls to VcsDownloader::prepareUrls()
VcsDownloader::download in vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php
@inheritDoc
VcsDownloader::install in vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php
@inheritDoc
VcsDownloader::update in vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php, line 335

Class

VcsDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

private function prepareUrls(array $urls) : array {
    foreach ($urls as $index => $url) {
        if (Filesystem::isLocalPath($url)) {
            // realpath() below will not understand
            // url that starts with "file://"
            $fileProtocol = 'file://';
            $isFileProtocol = false;
            if (0 === strpos($url, $fileProtocol)) {
                $url = substr($url, strlen($fileProtocol));
                $isFileProtocol = true;
            }
            // realpath() below will not understand %20 spaces etc.
            if (false !== strpos($url, '%')) {
                $url = rawurldecode($url);
            }
            $urls[$index] = realpath($url);
            if ($isFileProtocol) {
                $urls[$index] = $fileProtocol . $urls[$index];
            }
        }
    }
    return $urls;
}

API Navigation

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