This is my current autoLoader:
function classAutoLoad($class) {
if (file_exists($_SERVER['DOCUMENT_ROOT']."/framework/includes/class/$class.class.php"))
include($_SERVER['DOCUMENT_ROOT']."/framework/includes/class/".$class.".class.php");
}
spl_autoload_register('classAutoload');
Usage:
$class = new Classname;
Basically it will load all classes inside /class/, not including directories. What I am trying to do is, be more clean.
I have a lot of classes, and I want to package them into directories.
How can I enable support for packages here? Or is there a popular library for this?
PSR-0naming convention (there are others, the naming convention is probably what matters most here).