You are here

function xautoload_ClassFinder_Prefix::registerPrefixPlugin in X Autoload 7.2

Same name and namespace in other branches
  1. 7.3 lib/ClassFinder/Prefix.php \xautoload_ClassFinder_Prefix::registerPrefixPlugin()

Register a plugin for a prefix.

Parameters

string $prefix: The prefix, e.g. "My_Library"

xautoload_Plugin_Interface $plugin: The plugin. See

1 call to xautoload_ClassFinder_Prefix::registerPrefixPlugin()
xautoload_ClassFinder_Prefix::registerPrefixHandler in lib/ClassFinder/Prefix.php
Legacy: Plugins were called Handlers before.

File

lib/ClassFinder/Prefix.php, line 106

Class

xautoload_ClassFinder_Prefix

Code

function registerPrefixPlugin($prefix, $plugin) {
  $path_prefix_symbolic = strlen($prefix) ? str_replace('_', DIRECTORY_SEPARATOR, $prefix . '_') : '';
  $this->prefixMap
    ->registerNamespacePlugin($path_prefix_symbolic, $plugin);
}