Hmm, I use JLoader instead of adding a new file.
For each subdirectory in libraries, I check to see if the file loader.php exists - if so, I include it.
I follow that up with a call to
if (class_exists('LibraryLoader')) {
LibraryLoader::setup();
}
I'm actually doing this pseodo-recursively, ie my folder layout is:
libraries/crafty
libraries/crafty/crafty
libraries/crafty/raptor
libraries/crafty/quotes
Where libraries/crafty actually consists of nothing but the file loader.php
libraries/crafty/crafty are my main libs
libraries/crafty/raptor are some libs I needed to integrate the Raptor editor
libraries/crafty/quotes are some libs for my Quotation component
So CraftyLoader->setup() is the only bootstrap item[which I use the fact that the CMS will include a file called defines.php from the folder index.php is in if it exists - so it bootstraps the whole thing]
CraftyLoader->setup() then goes and checks to see if it has any sub-folders and if so, checks them for loader.php files and will include them and execute their setup method if any.
Even though all these classes are subclassed off of JLoader, I actually have been calling JLoader::registerPrefix in each of them rather than add more spl autoloaders. I figure it's nice to have the functionality of JLoader for the future, but it's not needed.
The main reason I like this method is that it as closely mirrors the existing Joomla process without creating a new api.