mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Add --repository flag to init command, and rename --repository-url to --repository in create-project, fixes #4200, closes #4207, closes #2604, fixes #2920
This commit is contained in:
parent
b6b2635f42
commit
1aec1c1fc8
12 changed files with 218 additions and 95 deletions
|
@ -31,6 +31,7 @@ use Composer\Repository\CompositeRepository;
|
|||
use Composer\Repository\ComposerRepository;
|
||||
use Composer\Repository\PlatformRepository;
|
||||
use Composer\Repository\RepositoryInterface;
|
||||
use Composer\Repository\RepositoryFactory;
|
||||
use Composer\Spdx\SpdxLicenses;
|
||||
|
||||
/**
|
||||
|
@ -106,7 +107,7 @@ EOT
|
|||
if ($composer) {
|
||||
$repos = new CompositeRepository($composer->getRepositoryManager()->getRepositories());
|
||||
} else {
|
||||
$defaultRepos = Factory::createDefaultRepositories($io);
|
||||
$defaultRepos = RepositoryFactory::default($io);
|
||||
$repos = new CompositeRepository($defaultRepos);
|
||||
$io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
|
||||
}
|
||||
|
@ -115,7 +116,7 @@ EOT
|
|||
$installedRepo = new CompositeRepository(array($localRepo, $platformRepo));
|
||||
$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
|
||||
} elseif ($input->getOption('all')) {
|
||||
$defaultRepos = Factory::createDefaultRepositories($io);
|
||||
$defaultRepos = RepositoryFactory::default($io);
|
||||
$io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
|
||||
$installedRepo = $platformRepo;
|
||||
$repos = new CompositeRepository(array_merge(array($installedRepo), $defaultRepos));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue