You are here

function xautoload_InjectedAPI_hookXautoload::setLibrary in X Autoload 7.2

Same name and namespace in other branches
  1. 7.3 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.

File

lib/InjectedAPI/hookXautoload.php, line 189

Class

xautoload_InjectedAPI_hookXautoload
An instance of this class is passed around to implementations of hook_xautoload().

Code

function setLibrary($library) {
  if (!module_exists('libraries')) {
    throw new Exception('Libraries module not installed.');
  }
  $this->extensionDir = libraries_get_path($library);
}