I've made this little script here which looks in a dir, and loads all the classed, and includes their files.
$myDirectory = opendir("required/classes");
// get each entry
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
// close directory
closedir($myDirectory);
// count elements in array
$indexCount = count($dirArray);
sort($dirArray);
for($index=0; $index < $indexCount; $index++) {
if($dirArray[$index] != '.' AND $dirArray[$index] != '..') {
include("required/classes/$dirArray[$index]");
$classname = strtolower($dirArray[$index]);
$classname = str_replace('.php','',$classname);
$classinit = str_replace('.php','',$dirArray[$index]);
$$classname = new $classinit;
}
}