From 0fc3f8a7a80ddebbd0c6f84085b9492764ede65f Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 26 May 2015 13:51:38 +0200
Subject: [PATCH] Ensure that config.php is optional for module loading.

Currently, if we try to load a class from a module, and the config.php
is absent, we will get an error about the missing configuration file.

There is no reason for the configuration file to be mandatory here,
since we have reasonable fallbacks, so fix the code to make it
optional.

This should make it easier to write tests for code in modules.
---
 lib/SimpleSAML/Module.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 45b1ae6f5..0620d600a 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -41,7 +41,7 @@ class SimpleSAML_Module {
 			return FALSE;
 		}
 
-		$globalConfig = SimpleSAML_Configuration::getInstance();
+		$globalConfig = SimpleSAML_Configuration::getOptionalConfig();
 		$moduleEnable = $globalConfig->getArray('module.enable', array());
 
 		if(isset($moduleEnable[$module])) {
-- 
GitLab