From 8f1d5f9076bf569e8276e821129b97664f0f6405 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 18 May 2015 12:40:58 +0000 Subject: [PATCH] config : allow to force the configuration file when it is set in the object (and not use the default ones) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2184 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- config.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.php b/config.php index f1b3ab6..4c8e903 100644 --- a/config.php +++ b/config.php @@ -33,7 +33,9 @@ class config /** Select the configuration file */ public function selectConfFile () { - if (defined("CONFIGFILE")) + if ($this->confFile !== null) + $this->confFile = $this->confFile; + elseif (defined("CONFIGFILE")) $this->confFile = CONFIGFILE; elseif (file_exists ("./datas/configuration.php")) $this->confFile = "./datas/configuration.php"; @@ -51,6 +53,7 @@ class config /** Return the defined values */ public function getAll () { + $this->selectConfFile (); $conf = array (); $rc = include ($this->confFile); if ($rc !== 1)