Connexion to database

This commit is contained in:
Pierre
2017-05-17 14:01:36 +02:00
parent 09eaa2171c
commit 2fb7d0d43d
5 changed files with 642 additions and 1 deletions

View File

@ -19,4 +19,25 @@ foreach(glob(PROJECT_PATH."functions/*.php") as $funcFile){
}
//Create root object
$cs = new CS();
$cs = new CS();
//Create configuration element
$config = new config();
$cs->register("config", $config);
//Include configuration
foreach(glob(PROJECT_PATH."config/*.php") as $confFile){
require $confFile;
}
//Connexion to the database
$db = new DBLibrary(($cs->config->get("site_mode") == "debug"));
$cs->register("db", $db);
$db->openMYSQL($cs->config->get('mysql')['host'],
$cs->config->get('mysql')['user'],
$cs->config->get('mysql')['password'],
$cs->config->get('mysql')['database']);
//Delete created elements (security)
unset($config);
unset($db);