<?php
/*
* Register an Autoloader for Co3 classes.
* This Autoloader assumes that:
* -every Namespace has a seperate directory
* -every class has a seperate file
* -every class file is named {$classname}.php
*/
spl_autoload_register(
function($name){
$classDirectory = __DIR__.'/class';
$classPath = str_replace('\\','/',"{$name}.php");
$fullPath = "{$classDirectory}/{$classPath}";
if(file_exists($fullPath)){
require ($fullPath);
} else {
return false;
}
}
);
?>
|