function ClassFinderAdapter::addPear in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/Adapter/ClassFinderAdapter.php \Drupal\xautoload\Adapter\ClassFinderAdapter::addPear()
Add PEAR-like prefix. This will assume with no further checks that $prefix contains no namespace separator.
Parameters
$prefix:
$paths:
Overrides CommonRegistrationInterface::addPear
File
- lib/
Adapter/ ClassFinderAdapter.php, line 255
Class
- ClassFinderAdapter
- An instance of this class is passed around to implementations of hook_xautoload(). It acts as a wrapper around the ClassFinder, to register stuff.
Namespace
Drupal\xautoload\AdapterCode
function addPear($prefix, $paths) {
$logical_base_path = Util::prefixLogicalPath($prefix);
foreach ((array) $paths as $root_path) {
$deep_path = strlen($root_path) ? rtrim($root_path, '/') . '/' . $logical_base_path : $logical_base_path;
$this->prefixMap
->registerDeepPath($logical_base_path, $deep_path, $this->defaultBehavior);
}
}