From 64e6886c9cf5617ebfbf36638c8f4a01d9870f45 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 24 Oct 2014 13:51:23 +0200 Subject: [PATCH] Make it possible to pass the module paths directly to the module manager --- library/Icinga/Application/Modules/Manager.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 60c2ee85b..f2f7bc779 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -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);