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
This commit is contained in:
2015-05-18 12:40:58 +00:00
parent 016fac4be3
commit 8f1d5f9076

View File

@@ -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)