diff --git a/src/Composer/Repository/CompositeRepository.php b/src/Composer/Repository/CompositeRepository.php index d6e49763c..3467f04d9 100644 --- a/src/Composer/Repository/CompositeRepository.php +++ b/src/Composer/Repository/CompositeRepository.php @@ -33,7 +33,10 @@ class CompositeRepository implements RepositoryInterface */ public function __construct(array $repositories) { - $this->repositories = $repositories; + $this->repositories = array(); + foreach ($repositories as $repo) { + $this->addRepository($repo); + } } /** @@ -150,6 +153,12 @@ class CompositeRepository implements RepositoryInterface */ public function addRepository(RepositoryInterface $repository) { - $this->repositories[] = $repository; + if ($repository instanceof self) { + foreach ($repository->getRepositories() as $repo) { + $this->addRepository($repo); + } + } else { + $this->repositories[] = $repository; + } } }