From 488e794c9b0b3d2390b72c93d035b0e279801399 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 23 Jun 2012 13:04:23 +0200 Subject: [PATCH] Merge repos instead of replacing --- src/Composer/Config.php | 11 ++++++++++- tests/Composer/Test/FactoryTest.php | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index d202f2e10..e507bd75d 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -51,7 +51,16 @@ class Config } if (!empty($config['repositories']) && is_array($config['repositories'])) { - $this->repositories = $config['repositories']; + $this->repositories = array_reverse($this->repositories, true); + $this->repositories = array_merge($this->repositories, $config['repositories']); + $this->repositories = array_reverse($this->repositories, true); + + // filter out disabled ones + foreach ($this->repositories as $name => $url) { + if (false === $url) { + unset($this->repositories[$name]); + } + } } } diff --git a/tests/Composer/Test/FactoryTest.php b/tests/Composer/Test/FactoryTest.php index 7ed92846b..55ec0e920 100644 --- a/tests/Composer/Test/FactoryTest.php +++ b/tests/Composer/Test/FactoryTest.php @@ -68,7 +68,6 @@ class FactoryTest extends \PHPUnit_Framework_TestCase $multirepo = array( 'example.com' => 'http://example.com', - 'packagist' => 'http://packagist.org', ); $data[] = array(