Skip to content

Instantly share code, notes, and snippets.

@meltingice
Created March 8, 2010 04:26
Show Gist options
  • Save meltingice/324865 to your computer and use it in GitHub Desktop.
Save meltingice/324865 to your computer and use it in GitHub Desktop.
function __autoload($class){
$classes = array(
'OsimoBBParser'=>'bbparser',
'OsimoForum'=>'forum',
'OsimoModel'=>'osimomodel',
'OsimoPost'=>'post',
'OsimoThread'=>'thread',
'OsimoUser'=>'user'
);
$modules = array(
'OsimoCache'=>'cache',
'OsimoData'=>'data',
'OsimoDB'=>'db2',
'OsimoDebug'=>'debug',
'OsimoPaths'=>'paths',
'OsimoTheme'=>'theme'
);
if(isset($classes[$class])){
$inc = ABS_INC_CLASSES.$classes[$class].'.class.php';
}
elseif(isset($modules[$class])){
$inc = ABS_INC_MODULES.$modules[$class].'.module.php';
}
else{
return false;
}
include_once($inc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment