Autoloading


Description


The ClassLoader class handles autoloading of classes in the Mako Framework. It will also autoload classes from any PSR-0 compatible library located in the libraries directory.


Methods


addClass(string $className, string $classPath)


The addClass method will add a class to the autoloader mappings.


ClassLoader::addClass('FooBar', '/path/to/FooBar.php');

ClassLoader::addClass('foo\FooBar', '/path/to/foo/FooBar.php');

addClasses(array $classes)


The addClasses method will add an array of classes to the autoloader mappings.


ClassLoader::addClasses(array
(
	'Foo' => '/path/to/Foo.php',
	'Bar' => '/path/to/Bar.php',
));

directory(string $path)


The directory method will add an additional path from which the autoloader will try to load PSR-0 compatible classes.


ClassLoader::directory('/path/to/library');