From 3706394fa93611fc33658e1f6928c3949c713ec1 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Wed, 9 Oct 2024 16:03:33 -0400 Subject: [PATCH] make conf_file variable instead of using the file path twice --- src/includes/config.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/includes/config.php b/src/includes/config.php index db7919c..ffa7b46 100644 --- a/src/includes/config.php +++ b/src/includes/config.php @@ -15,11 +15,12 @@ function getGlobalOptions() { // Read information + $conf_file = '/var/www/conf/phpgiftreg.conf'; $mysql_conn_string = "mysql:host=localhost;dbname=giftreg"; $mysql_username = "giftreg"; $mysql_password = "cn3Malk"; - if (file_exists('/var/www/conf/phpgiftreg.conf')) { - $ini_file = parse_ini_file('/var/www/conf/phpgiftreg.conf'); + if (file_exists($conf_file)) { + $ini_file = parse_ini_file($conf_file); if (isset($ini_file['mysql_conn_string'])) { $mysql_conn_string = $ini_file['mysql_conn_string']; }