From 3da13b352b69c8debf008d315cb764b09adaaa76 Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Tue, 24 Sep 2019 00:20:35 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9cup=C3=A9ration=20des=20variables=20d'en?= =?UTF-8?q?vironnement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_files/config.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server_files/config.php b/server_files/config.php index 056262b..98b892a 100644 --- a/server_files/config.php +++ b/server_files/config.php @@ -3,19 +3,19 @@ * Config options */ -$YEAR = $_ENV["CORRES2MATH_YEAR"]; -$URL_BASE = $_ENV["CORRES2MATH_URL_BASE"]; -$LOCAL_PATH = $_ENV["CORRES2MATH_LOCAL_PATH"]; -$MAIL_DOMAIN = $_ENV["CORRES2MATH_MAIL_DOMAIN"]; +$YEAR = getenv("CORRES2MATH_YEAR"); +$URL_BASE = getenv("CORRES2MATH_URL_BASE"); +$LOCAL_PATH = getenv("CORRES2MATH_LOCAL_PATH"); +$MAIL_DOMAIN = getenv("CORRES2MATH_MAIL_DOMAIN"); /** * DB infos */ -$DB_HOST = $_ENV["CORRES2MATH_DB_HOST"]; -$DB_NAME = $_ENV["CORRES2MATH_DB_NAME"]; -$DB_USER = $_ENV["CORRES2MATH_DB_USER"]; -$DB_PASSWORD = $_ENV["CORRES2MATH_DB_PASSWORD"]; +$DB_HOST = getenv("CORRES2MATH_DB_HOST"); +$DB_NAME = getenv("CORRES2MATH_DB_NAME"); +$DB_USER = getenv("CORRES2MATH_DB_USER"); +$DB_PASSWORD = getenv("CORRES2MATH_DB_PASSWORD"); try { $DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8", "$DB_USER", "$DB_PASSWORD", array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));