1
0
Fork 0

Show proper repo information and not always the default ones

pull/1550/merge
Jordi Boggiano 2013-02-19 11:54:20 +01:00
parent 8ac4b649c3
commit 518253e150
1 changed files with 8 additions and 2 deletions

View File

@ -82,14 +82,20 @@ EOT
$repos = $installedRepo = $getRepositories($this->getComposer(), $input->getOption('dev'));
} elseif ($input->getOption('available')) {
$installedRepo = $platformRepo;
$repos = new CompositeRepository(Factory::createDefaultRepositories($this->getIO()));
if ($composer = $this->getComposer(false)) {
$repos = new CompositeRepository($composer->getRepositoryManager()->getRepositories());
} else {
$defaultRepos = Factory::createDefaultRepositories($this->getIO());
$repos = new CompositeRepository($defaultRepos);
$output->writeln('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
}
} elseif ($composer = $this->getComposer(false)) {
$localRepo = $getRepositories($composer, $input->getOption('dev'));
$installedRepo = new CompositeRepository(array($localRepo, $platformRepo));
$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
} else {
$defaultRepos = Factory::createDefaultRepositories($this->getIO());
$output->writeln('No composer.json found in the current directory, showing packages from ' . implode(', ', array_keys($defaultRepos)));
$output->writeln('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));
}