1
0
Fork 0

Add support for multiple packages defining the same namespace prefix

pull/80/merge
Jordi Boggiano 2011-11-03 21:10:39 +01:00
parent bd712db727
commit 5e3c55f171
1 changed files with 8 additions and 1 deletions

View File

@ -54,8 +54,15 @@ class ClassLoader
*/ */
public function add($prefix, $paths) public function add($prefix, $paths)
{ {
if (isset($this->prefixes[$prefix])) {
$this->prefixes[$prefix] = array_merge(
$this->prefixes[$prefix],
(array) $paths
);
} else {
$this->prefixes[$prefix] = (array) $paths; $this->prefixes[$prefix] = (array) $paths;
} }
}
/** /**
* Registers this instance as an autoloader. * Registers this instance as an autoloader.