From a4b9eb0267dd7a4dd6e49134e80b1dc8712160e3 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 26 Jul 2016 07:31:42 +0000 Subject: [PATCH] config : allow the first values to not be an array git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2959 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- config.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.php b/config.php index 52036c4..b35be42 100644 --- a/config.php +++ b/config.php @@ -94,6 +94,12 @@ class config // Create a conf where all the keys are defined. If the keys are already // define, use them, or use the default ones // Don't allow keys not defined in default ones + if (! is_array ($this->default[$param])) + { + if (! array_key_exists ($param, $conf)) + return $this->default[$param]; + return $conf[$param]; + } foreach ($this->default[$param] as $key=>$val) { if ($key === "not configured")