*/
class FrameworkLoader extends Loader
{
public static function autoload($class)
{
if (strpos($class, ROOT_NAMESPACE) !== false)
{
/*
* here we cas use include for better efficiency
* because this called only once anyway
*/
$fileName = FRAMEWORK_DIR . DS . str_replace(ROOT_NAMESPACE . DS, "", str_replace('\\', DS, $class)) . '.php';
if (file_exists($fileName))
{
include $fileName;
return true;
}
}
}
public function commit()
{
spl_autoload_register(array(__CLASS__,'autoload'));
}
}