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:
@@ -33,7 +33,9 @@ class config
|
|||||||
/** Select the configuration file */
|
/** Select the configuration file */
|
||||||
public function selectConfFile ()
|
public function selectConfFile ()
|
||||||
{
|
{
|
||||||
if (defined("CONFIGFILE"))
|
if ($this->confFile !== null)
|
||||||
|
$this->confFile = $this->confFile;
|
||||||
|
elseif (defined("CONFIGFILE"))
|
||||||
$this->confFile = CONFIGFILE;
|
$this->confFile = CONFIGFILE;
|
||||||
elseif (file_exists ("./datas/configuration.php"))
|
elseif (file_exists ("./datas/configuration.php"))
|
||||||
$this->confFile = "./datas/configuration.php";
|
$this->confFile = "./datas/configuration.php";
|
||||||
@@ -51,6 +53,7 @@ class config
|
|||||||
/** Return the defined values */
|
/** Return the defined values */
|
||||||
public function getAll ()
|
public function getAll ()
|
||||||
{
|
{
|
||||||
|
$this->selectConfFile ();
|
||||||
$conf = array ();
|
$conf = array ();
|
||||||
$rc = include ($this->confFile);
|
$rc = include ($this->confFile);
|
||||||
if ($rc !== 1)
|
if ($rc !== 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user