1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-01-07 13:02:21 +00:00

Récupération des variables d'environnement

This commit is contained in:
galaxyoyo 2019-09-24 00:20:35 +02:00
parent 8e636107d9
commit 3da13b352b

View File

@ -3,19 +3,19 @@
* Config options * Config options
*/ */
$YEAR = $_ENV["CORRES2MATH_YEAR"]; $YEAR = getenv("CORRES2MATH_YEAR");
$URL_BASE = $_ENV["CORRES2MATH_URL_BASE"]; $URL_BASE = getenv("CORRES2MATH_URL_BASE");
$LOCAL_PATH = $_ENV["CORRES2MATH_LOCAL_PATH"]; $LOCAL_PATH = getenv("CORRES2MATH_LOCAL_PATH");
$MAIL_DOMAIN = $_ENV["CORRES2MATH_MAIL_DOMAIN"]; $MAIL_DOMAIN = getenv("CORRES2MATH_MAIL_DOMAIN");
/** /**
* DB infos * DB infos
*/ */
$DB_HOST = $_ENV["CORRES2MATH_DB_HOST"]; $DB_HOST = getenv("CORRES2MATH_DB_HOST");
$DB_NAME = $_ENV["CORRES2MATH_DB_NAME"]; $DB_NAME = getenv("CORRES2MATH_DB_NAME");
$DB_USER = $_ENV["CORRES2MATH_DB_USER"]; $DB_USER = getenv("CORRES2MATH_DB_USER");
$DB_PASSWORD = $_ENV["CORRES2MATH_DB_PASSWORD"]; $DB_PASSWORD = getenv("CORRES2MATH_DB_PASSWORD");
try { try {
$DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8", "$DB_USER", "$DB_PASSWORD", array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); $DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8", "$DB_USER", "$DB_PASSWORD", array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));