2016-02-01 22:09:35 +00:00
|
|
|
<?php
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// On definit l'autoloader
|
2016-02-03 22:22:18 +00:00
|
|
|
spl_autoload_register('autoloader', false, true);
|
2016-02-01 22:09:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
?>
|