Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into cach…
Browse files Browse the repository at this point in the history
…e_internals

Conflicts:
	library/Zend/Cache/Storage/Adapter/Filesystem.php
  • Loading branch information
marc-mabe committed Mar 16, 2012
2 parents eb86581 + 425fd03 commit 0878a3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/ModuleAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,22 @@ public function unregister()
*/
public function registerPaths($paths)
{
if (is_array($paths) || $paths instanceof Traversable) {
foreach ($paths as $module => $path) {
if (is_string($module)) {
$this->registerPath($path, $module);
} else {
$this->registerPath($path);
}
}
} else {
if (!is_array($paths) && !$paths instanceof Traversable) {
throw new \InvalidArgumentException(
'Parameter to \\Zend\\Loader\\ModuleAutoloader\'s '
. 'registerPaths method must be an array or '
. 'implement the \\Traversable interface'
);
}

foreach ($paths as $module => $path) {
if (is_string($module)) {
$this->registerPath($path, $module);
} else {
$this->registerPath($path);
}
}

return $this;
}

Expand Down
1 change: 1 addition & 0 deletions test/ModuleAutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,5 @@ public function testCanLoadModulesFromExplicitLocation()
$this->assertTrue(class_exists('My\NonmatchingModule\Module'));
$this->assertTrue(class_exists('PharModuleExplicit\Module'));
}

}

0 comments on commit 0878a3d

Please sign in to comment.