|
@@ -128,11 +128,7 @@ class Conf
|
|
|
|
|
|
dol_syslog(get_class($this)."::setValues");
|
|
|
|
|
|
- /*
|
|
|
- * Definition de toutes les constantes globales d'environnement
|
|
|
- * - En constante php (TODO a virer)
|
|
|
- * - En $this->global->key=value
|
|
|
- */
|
|
|
+ //Define all global constants into $this->global->key=value
|
|
|
$sql = "SELECT ".$db->decrypt('name')." as name,";
|
|
|
$sql.= " ".$db->decrypt('value')." as value, entity";
|
|
|
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
|
@@ -158,7 +154,7 @@ class Conf
|
|
|
$value=$objp->value;
|
|
|
if ($key)
|
|
|
{
|
|
|
- if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
|
|
|
+ //if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
|
|
|
$this->global->$key=$value;
|
|
|
|
|
|
if ($value && preg_match('/^MAIN_MODULE_/',$key))
|
|
@@ -207,7 +203,7 @@ class Conf
|
|
|
$db->free($resql);
|
|
|
}
|
|
|
|
|
|
- // Include other local consts.php files and fetch their values to the corresponding database constants
|
|
|
+ // Include other local consts.php files and fetch their values to the corresponding database constants.
|
|
|
if (! empty($this->global->LOCAL_CONSTS_FILES)) {
|
|
|
$filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
|
|
|
foreach ($filesList as $file) {
|
|
@@ -333,13 +329,12 @@ class Conf
|
|
|
$this->propal->dir_output=$rootfordata."/propale";
|
|
|
$this->propal->dir_temp=$rootfordata."/propale/temp";
|
|
|
|
|
|
- // Exception: Some dir are not the name of module. So we keep exception here
|
|
|
- // for backward compatibility.
|
|
|
+ // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility.
|
|
|
|
|
|
// Sous module bons d'expedition
|
|
|
- $this->expedition_bon->enabled= defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
|
|
|
+ $this->expedition_bon->enabled=$this->global->MAIN_SUBMODULE_EXPEDITION?$this->global->MAIN_SUBMODULE_EXPEDITION:0;
|
|
|
// Sous module bons de livraison
|
|
|
- $this->livraison_bon->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
|
|
|
+ $this->livraison_bon->enabled=$this->global->MAIN_SUBMODULE_LIVRAISON?$this->global->MAIN_SUBMODULE_LIVRAISON:0;
|
|
|
|
|
|
// Module fournisseur
|
|
|
if (! empty($this->fournisseur))
|
|
@@ -599,8 +594,8 @@ class Conf
|
|
|
}
|
|
|
|
|
|
// We init log handlers
|
|
|
- if (defined('SYSLOG_HANDLERS')) {
|
|
|
- $handlers = json_decode(constant('SYSLOG_HANDLERS'));
|
|
|
+ if (! empty($this->global->SYSLOG_HANDLERS)) {
|
|
|
+ $handlers = json_decode($this->global->SYSLOG_HANDLERS);
|
|
|
} else {
|
|
|
$handlers = array();
|
|
|
}
|
|
@@ -632,6 +627,7 @@ class Conf
|
|
|
$this->loghandlers[$handler] = $loghandlerinstance;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|