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\DownloaderCode
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;
}