First PUsh

This commit is contained in:
2018-11-26 14:38:47 +09:00
commit d9e043c468
33 changed files with 8648 additions and 0 deletions

24
src/Autoloader.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace CAUProject3Contact;
class Autoloader {
/**
* Enregistre notre autoloader
*/
static function register() {
spl_autoload_register( array( __CLASS__, 'autoload' ) );
}
/**
* Inclue le fichier correspondant à notre classe
*
* @param $class string Le nom de la classe à charger
*/
static function autoload( $class ) {
if ( preg_match( '#^' . Config::NAMESPACE . '\\\(.+)$#', $class, $matches ) ) {
require 'src/' . str_replace( '\\', '/', $matches[1] ) . '.php';
}
}
}