Add a lot
This commit is contained in:
@ -4,21 +4,21 @@ namespace CAUProject3Contact;
|
||||
|
||||
class Autoloader {
|
||||
|
||||
/**
|
||||
* Enregistre notre autoloader
|
||||
*/
|
||||
static function register() {
|
||||
spl_autoload_register( array( __CLASS__, 'autoload' ) );
|
||||
}
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user