function xautoload_InjectedAPI_hookXautoload::setLibrary in X Autoload 7.3
Same name and namespace in other branches
- 7.2 lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::setLibrary()
Set a library to use as base for relative paths. This is called e.g. in libraries_xautoload(), before passing the $api object to library xautoload callbacks.
Parameters
string $library: Machine name of the library.
Throws
Exception
File
- lib/
InjectedAPI/ hookXautoload.php, line 211
Class
- xautoload_InjectedAPI_hookXautoload
- An instance of this class is passed around to implementations of hook_xautoload(). It acts as a wrapper around the ClassFinder, to register stuff.
Code
function setLibrary($library) {
if (!module_exists('libraries')) {
throw new Exception('Libraries module not installed.');
}
$this->extensionDir = libraries_get_path($library);
}