Make it possible to pass the module paths directly to the module manager

This commit is contained in:
Johannes Meyer 2014-10-24 13:51:23 +02:00
parent ffc69c378c
commit 64e6886c9c

View File

@ -487,11 +487,14 @@ class Manager
/** /**
* Detect installed modules from every path provided in modulePaths * Detect installed modules from every path provided in modulePaths
* *
* @param array $availableDirs Installed modules location
*
* @return self * @return self
*/ */
public function detectInstalledModules() public function detectInstalledModules(array $availableDirs = null)
{ {
foreach ($this->modulePaths as $basedir) { $modulePaths = $availableDirs !== null ? $availableDirs : $this->modulePaths;
foreach ($modulePaths as $basedir) {
$canonical = realpath($basedir); $canonical = realpath($basedir);
if ($canonical === false) { if ($canonical === false) {
Logger::warning('Module path "%s" does not exist', $basedir); Logger::warning('Module path "%s" does not exist', $basedir);