Commit a0b6b2db authored by jehan's avatar jehan

add default value to config params

parent b30d1a09
Pipeline #12500 failed with stages
in 1 minute and 19 seconds
......@@ -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"
......
......@@ -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!");
}
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment