I currently maintain a large PHP (5.4) codebase w/ 500+ classes. We provide a custom client/application override structure that allows classes to be dynamically extended when necessary. All classes exist in the root lib/ directory, with sub-directories for each custom client (i.e. lib/foo/).
By utilizing __autoload() we instantiate the appropriate class at run time and class_alias it to the requested name (i.e. class bar extends bar_base)
I'd like to further organize the classes into appropriate sub-directories, but can't figure out a way to achieve that without namespacing. I don't want to sequentially scan all sub-dirs when instantiating an object, but can't think of a solid way to key the autoloader off to where the class exists. The one idea I've been playing with is naming the classes with leading underscores (_profiile_registration), but it seems hacky.
Any insight at all is appreciated.