2
0
forked from Wavyzz/dolibarr

get conf global function

This commit is contained in:
Frédéric FRANCE
2021-03-19 17:58:01 +01:00
parent 3414511d7f
commit 4c5ddc44dc
2 changed files with 26 additions and 3 deletions

View File

@@ -41,6 +41,29 @@
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
/**
* Return dolibarr global constant string value
* @param string $key key to return value, return '' if not set
* @return string
*/
function getDolGlobalString($key)
{
global $conf;
// return $conf->global->$key ?? '';
return (string) (empty($conf->global->$key) ? '' : $conf->global->$key);
}
/**
* Return dolibarr global constant int value
* @param string $key key to return value, return 0 if not set
* @return int
*/
function getDolGlobalInt($key)
{
global $conf;
// return $conf->global->$key ?? 0;
return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key);
}
/**
* Return a DoliDB instance (database handler).