diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index b55049548..ca1d262ac 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -452,10 +452,15 @@ abstract class ApplicationBootstrap protected function getAvailableModulePaths() { - $paths = array(); - $configured = $this->config->get('global', 'module_path', $this->baseDir . '/modules'); + $paths = []; + + $configured = getenv('ICINGAWEB_MODULES_DIR'); + if (! $configured) { + $configured = $this->config->get('global', 'module_path', $this->baseDir . '/modules'); + } + $nextIsPhar = false; - foreach (explode(':', $configured) as $path) { + foreach (explode(PATH_SEPARATOR, $configured) as $path) { if ($path === 'phar') { $nextIsPhar = true; continue; diff --git a/modules/test/application/clicommands/PhpCommand.php b/modules/test/application/clicommands/PhpCommand.php index 2ff89c28d..4d80da97a 100644 --- a/modules/test/application/clicommands/PhpCommand.php +++ b/modules/test/application/clicommands/PhpCommand.php @@ -197,10 +197,10 @@ class PhpCommand extends Command $vars[] = sprintf('ICINGAWEB_MODULE_DIRS=%s', implode(':', $modulePaths)); // Disabled as the bootstrap.php for PHPUnit and class BaseTestCase can't handle multiple paths yet - /*$vars[] = sprintf( + $vars[] = sprintf( 'ICINGAWEB_MODULES_DIR=%s', implode(PATH_SEPARATOR, $this->app->getModuleManager()->getModuleDirs()) - );*/ + ); return join(' ', $vars) . ' '; }