add default value to config params

This commit is contained in:
Jehan Monnier 2020-02-28 13:18:01 +01:00
parent b30d1a09f5
commit a0b6b2db8b
3 changed files with 6 additions and 2 deletions

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 17
%define build_number 18
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
%define env_file "$RPM_BUILD_ROOT/etc/flexisip-account-manager/flexiapi.env"

View file

@ -29,7 +29,7 @@ class Database
$this->conn = null;
try {
if(!empty(DB_ENABLE_SSL) && !empty(ROOT_CA_PATH)){
if(!empty(get_config_value("DB_ENABLE_SSL","")) && !empty(get_config_value("ROOT_CA_PATH",""))){
if(!file_exists (ROOT_CA_PATH)){
Logger::getInstance()->error("MySQL connection error: the provided ROOT_CA_PATH does not exists!");
}

View file

@ -188,3 +188,7 @@ function time_elapsed_as_string($secs)
return join(' ', $ret);
}
function get_config_value($param_name, $default_value) {
return defined($param_name) ? constant($param_name) : $default_value;
}