You are here

function xautoload_InjectedAPI_hookXautoload::prefixPlugin in X Autoload 7.5

Same name and namespace in other branches
  1. 7.2 lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::prefixPlugin()
  2. 7.3 lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::prefixPlugin()
  3. 7.4 legacy/lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::prefixPlugin()

Register a prefix plugin object

Parameters

string $prefix:

xautoload_FinderPlugin_Interface $plugin:

Return value

string The key under which the plugin was registered. This can later be used to unregister the plugin again.

File

legacy/lib/InjectedAPI/hookXautoload.php, line 119

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 prefixPlugin($prefix, $plugin) {
  $key = Util::randomString();
  $this->finder
    ->registerPrefixDeep($prefix, $key, $plugin);
  return $key;
}