Add support for defining a {"packagist.org":false} repo in composer init, fixes #8210
parent
14f2a6dd9a
commit
3f5e4f0399
|
@ -168,13 +168,25 @@ EOT
|
|||
if ($repositories) {
|
||||
$config = Factory::createConfig($io);
|
||||
$repos = array(new PlatformRepository);
|
||||
$createDefaultPackagistRepo = true;
|
||||
foreach ($repositories as $repo) {
|
||||
$repos[] = RepositoryFactory::fromString($io, $config, $repo);
|
||||
$repoConfig = RepositoryFactory::configFromString($io, $config, $repo);
|
||||
if (
|
||||
(isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false))
|
||||
|| (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false))
|
||||
) {
|
||||
$createDefaultPackagistRepo = false;
|
||||
continue;
|
||||
}
|
||||
$repos[] = RepositoryFactory::createRepo($io, $config, $repoConfig);
|
||||
}
|
||||
|
||||
if ($createDefaultPackagistRepo) {
|
||||
$repos[] = RepositoryFactory::createRepo($io, $config, array(
|
||||
'type' => 'composer',
|
||||
'url' => 'https://repo.packagist.org',
|
||||
));
|
||||
}
|
||||
$repos[] = RepositoryFactory::createRepo($io, $config, array(
|
||||
'type' => 'composer',
|
||||
'url' => 'https://repo.packagist.org',
|
||||
));
|
||||
|
||||
$this->repos = new CompositeRepository($repos);
|
||||
unset($repos, $config, $repositories);
|
||||
|
|
Loading…
Reference in New Issue