|
|
@ -582,17 +582,19 @@ class Package extends BasePackage
|
|
|
|
|
|
|
|
|
|
|
|
protected function getUrls($url, $mirrors, $ref, $type)
|
|
|
|
protected function getUrls($url, $mirrors, $ref, $type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$urls = array();
|
|
|
|
if (!$url) {
|
|
|
|
if ($url) {
|
|
|
|
return array();
|
|
|
|
$urls[] = $url;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$urls = array($url);
|
|
|
|
if ($mirrors) {
|
|
|
|
if ($mirrors) {
|
|
|
|
foreach ($mirrors as $mirror) {
|
|
|
|
foreach ($mirrors as $mirror) {
|
|
|
|
$mirrorUrl = ComposerMirror::processUrl($mirror['url'], $this->name, $this->version, $ref, $type);
|
|
|
|
$mirrorUrl = ComposerMirror::processUrl($mirror['url'], $this->name, $this->version, $ref, $type);
|
|
|
|
|
|
|
|
if (!in_array($urls, $mirrorUrl)) {
|
|
|
|
$func = $mirror['preferred'] ? 'array_unshift' : 'array_push';
|
|
|
|
$func = $mirror['preferred'] ? 'array_unshift' : 'array_push';
|
|
|
|
$func($urls, $mirrorUrl);
|
|
|
|
$func($urls, $mirrorUrl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $urls;
|
|
|
|
return $urls;
|
|
|
|
}
|
|
|
|
}
|
|
|
|