plateforme-tfjm2/server_files/config.php

30 lines
669 B
PHP
Raw Normal View History

2019-08-21 20:56:46 +00:00
<?php
/**
* Config options
*/
2019-09-08 22:58:53 +00:00
$YEAR = getenv("TFJM_YEAR");
$URL_BASE = getenv("TFJM_URL_BASE");
$LOCAL_PATH = getenv("TFJM_LOCAL_PATH");
$MAIL_DOMAIN = getenv("TFJM_MAIL_DOMAIN");
2019-08-21 20:56:46 +00:00
/**
* DB infos
*/
2019-09-08 22:58:53 +00:00
$DB_HOST = getenv("TFJM_DB_HOST");
$DB_NAME = getenv("TFJM_DB_NAME");
$DB_USER = getenv("TFJM_DB_USER");
$DB_PASSWORD = getenv("TFJM_DB_PASSWORD");
2019-08-21 20:56:46 +00:00
2020-04-12 22:35:22 +00:00
2019-08-21 20:56:46 +00:00
try {
$DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8", "$DB_USER", "$DB_PASSWORD", array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
2019-08-21 20:56:46 +00:00
}
catch (Exception $ex) {
die("Erreur lors de la connexion à la base de données : " . $ex->getMessage());
}
session_start();
setlocale(LC_ALL, "fr_FR.utf8");