From 8eaf60b1dfe83d4c987af5311ffe3a279885f56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no> Date: Tue, 19 Jul 2016 16:39:11 +0200 Subject: [PATCH] Do not enforce reading the configuration from files. The www/_include.php script, included by all scripts in www/, checks unconditionally for the existence of the config.php file. However, this prevents us from testing the scripts automatically. Instead of checking for the file, we just try to load the configuration, and live with it if it works. That way we can pre-load the configuration using SimpleSAML_Configuration::loadFromArray(), as we are doing in some tests. --- www/_include.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/_include.php b/www/_include.php index 8a5bf9be0..b5f506fa4 100644 --- a/www/_include.php +++ b/www/_include.php @@ -91,8 +91,9 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0 set_error_handler('SimpleSAML_error_handler'); -$configdir = SimpleSAML\Utils\Config::getConfigDir(); -if (!file_exists($configdir.'/config.php')) { +try { + SimpleSAML_Configuration::getInstance(); +} catch (Exception $e) { throw new \SimpleSAML\Error\CriticalConfigurationError( 'You have not yet created the SimpleSAMLphp configuration files.' ); -- GitLab