2016-02-12 15:20:26 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
2016-02-01 22:09:35 +00:00
|
|
|
|
2016-02-12 22:22:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
|
|
|
|
*
|
|
|
|
*/
|
2016-02-04 22:45:03 +00:00
|
|
|
function debug(){
|
|
|
|
ini_set('display_errors',1);
|
|
|
|
ini_set('display_startup_errors',1);
|
|
|
|
error_reporting(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-12 22:22:14 +00:00
|
|
|
/* AUTOLOADER
|
|
|
|
*
|
|
|
|
* @className<String> Nom de la classe appelee
|
|
|
|
*
|
|
|
|
*/
|
2016-02-03 22:22:18 +00:00
|
|
|
function autoloader($className){
|
2016-02-01 22:09:35 +00:00
|
|
|
$path = '';
|
|
|
|
|
|
|
|
/* [1] On utilise le namespace pour localiser
|
|
|
|
===============================================*/
|
|
|
|
// On remplace les '\' par des '/'
|
|
|
|
$path = str_replace('\\', '/', $className) . '.php';
|
|
|
|
$path = __ROOT__.'/'.$path;
|
|
|
|
|
|
|
|
// Si le fichier existe, on l'inclut
|
|
|
|
if( file_exists($path) )
|
|
|
|
require_once $path;
|
|
|
|
}
|
|
|
|
|
2016-02-12 15:20:26 +00:00
|
|
|
// On definit l'autoloader comme autoloader (obvious)
|
2016-02-03 22:22:18 +00:00
|
|
|
spl_autoload_register('autoloader', false, true);
|
2016-02-01 22:09:35 +00:00
|
|
|
|
|
|
|
|
2016-02-12 22:22:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* On demarre la session securisee PHP
|
|
|
|
=========================================================*/
|
|
|
|
// Condition ajoutee pour PHPUNIT
|
|
|
|
if( isset($_SERVER['REMOTE_ADDR']) )
|
|
|
|
\manager\sessionManager::session_start();
|
2016-02-01 22:09:35 +00:00
|
|
|
?>
|