2016-02-12 15:20:26 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
2016-02-01 22:09:35 +00:00
|
|
|
|
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-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
|
|
|
|
|
|
|
|
|
|
|
?>
|