Explorar el Código

Add support for multiple packages defining the same namespace prefix

Jordi Boggiano hace 13 años
padre
commit
5e3c55f171
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      src/Composer/Autoload/ClassLoader.php

+ 8 - 1
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;
+        }
     }
 
     /**