From 5e3c55f171e799b6bfcb58ca8aff0e99b2294ef7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Nov 2011 21:10:39 +0100 Subject: [PATCH] Add support for multiple packages defining the same namespace prefix --- src/Composer/Autoload/ClassLoader.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index d38da1bd2..76a0d6b1d 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -54,7 +54,14 @@ class ClassLoader */ public function add($prefix, $paths) { - $this->prefixes[$prefix] = (array) $paths; + if (isset($this->prefixes[$prefix])) { + $this->prefixes[$prefix] = array_merge( + $this->prefixes[$prefix], + (array) $paths + ); + } else { + $this->prefixes[$prefix] = (array) $paths; + } } /**