Utilisation de variables d'environnement pour les fichiers de configuration

This commit is contained in:
galaxyoyo 2019-09-07 11:35:47 +02:00
parent fd861ca8c9
commit 977f22af27
1 changed files with 9 additions and 9 deletions

View File

@ -3,22 +3,22 @@
* Config options * Config options
*/ */
$YEAR = 2020; $YEAR = $_ENV["TFJM_YEAR"];
$URL_BASE = "https://galaxyoyo.com/tfjm"; $URL_BASE = $_ENV["TFJM_URL_BASE"];
$LOCAL_PATH = "/var/www/html/tfjm"; $LOCAL_PATH = $_ENV["TFJM_LOCAL_PATH"];
$MAIL_ADDRESS = "contact@galaxyoyo.com"; $MAIL_ADDRESS = $_ENV["TFJM_MAIL_ADDRESS"];
/** /**
* DB infos * DB infos
*/ */
$DB_HOST = "localhost"; $DB_HOST = $_ENV["TFJM_DB_HOST"];
$DB_NAME = "tfjm"; $DB_NAME = $_ENV["TFJM_DB_NAME"];
$DB_USER = "galaxyoyo"; $DB_USER = $_ENV["TFJM_DB_USER"];
$DB_PWD = "***REMOVED***"; $DB_PASSWORD = $_ENV["TFJM_DB_PASSWORD"];
try { try {
$DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8", "$DB_USER", "$DB_PWD", 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));
} }
catch (Exception $ex) { catch (Exception $ex) {
die("Erreur lors de la connexion à la base de données : " . $ex->getMessage()); die("Erreur lors de la connexion à la base de données : " . $ex->getMessage());