I thought I'd share a default PSR-0 autoloader implementation with everyone.
I've been using it on a few projects of mine, and it works quite well. The only modification I made to the default specification is adding the ability to use primitive resolvers.
Sample usage:
Code: Select all
// create an array that maps resolvers
$resolvers = array(
'library' => 'some/other/path'
);
// populate the autoloader with a namespace, path and resolvers
$autoloader = new Autoloader('Application', getcwd(), $resolvers);
$autoloader->register();
Enjoy.