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
1 changed files with 5 additions and 2 deletions

View File

@ -487,11 +487,14 @@ class Manager
/**
* Detect installed modules from every path provided in modulePaths
*
* @param array $availableDirs Installed modules location
*
* @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);
if ($canonical === false) {
Logger::warning('Module path "%s" does not exist', $basedir);