Nom de la classe appelee * */ function autoloader($className){ /* [1] Basic processing =========================================================*/ /* (1) Explode classname by namespaces */ $path = explode('\\', $className); /* (2) Check if at least a filename */ if( count($path) < 1 ) throw new \Exception('Missing classname for autoloader.'); /* (3) Detect if build class or lib class */ $type = $path[0] === 'lib' ? 'lib' : 'build'; /* [2] Manage type and check file =========================================================*/ /* (1) Build path according to type */ if( $type === 'lib' ) $file = __ROOT__.'/'.implode('/', $path).'.php'; else $file = __BUILD__.'/'.implode('/', $path).'.php'; /* (2) Check file */ if( file_exists($file) ) require_once $file; } // On definit l'autoloader comme autoloader (obvious) require_once __ROOT__.'/lib/vendor/autoload.php'; spl_autoload_register('autoloader', false, true); /* On demarre la session securisee PHP =========================================================*/ session_start(); // \manager\sessionManager::session_start(); ?>