2017-05-17 11:48:24 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Page initiator
|
|
|
|
*
|
|
|
|
* @author Pierre HUBERT
|
2017-05-17 11:51:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
//Define the base of the project
|
|
|
|
define("PROJECT_PATH", __DIR__."/");
|
|
|
|
|
|
|
|
//Include classes
|
|
|
|
foreach(glob(PROJECT_PATH."classes/*.php") as $classFile){
|
|
|
|
require_once $classFile;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Include functions
|
|
|
|
foreach(glob(PROJECT_PATH."functions/*.php") as $funcFile){
|
|
|
|
require_once $funcFile;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Create root object
|
2017-05-17 12:01:36 +00:00
|
|
|
$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);
|