Auto-detect packagist.org default repo replacements and deactivate it if it is redefined
parent
f37f3dab04
commit
4130d388fe
|
@ -78,8 +78,7 @@ class Config
|
||||||
public static $defaultRepositories = array(
|
public static $defaultRepositories = array(
|
||||||
'packagist.org' => array(
|
'packagist.org' => array(
|
||||||
'type' => 'composer',
|
'type' => 'composer',
|
||||||
'url' => 'https?://repo.packagist.org',
|
'url' => 'https://repo.packagist.org',
|
||||||
'allow_ssl_downgrade' => true,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -182,6 +181,10 @@ class Config
|
||||||
|
|
||||||
// store repo
|
// store repo
|
||||||
if (is_int($name)) {
|
if (is_int($name)) {
|
||||||
|
// auto-deactivate the default packagist.org repo if it gets redefined
|
||||||
|
if (isset($repository['type'], $repository['url']) && $repository['type'] === 'composer' && preg_match('{^https?://(?:[a-z0-9-.]+\.)?packagist.org(/|$)}', $repository['url'])) {
|
||||||
|
$this->disableRepoByName('packagist.org');
|
||||||
|
}
|
||||||
$this->repositories[] = $repository;
|
$this->repositories[] = $repository;
|
||||||
} else {
|
} else {
|
||||||
if ($name === 'packagist') { // BC support for default "packagist" named repo
|
if ($name === 'packagist') { // BC support for default "packagist" named repo
|
||||||
|
|
Loading…
Reference in New Issue