function ClassFinderAdapter::addNamespacePsr0 in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/Adapter/ClassFinderAdapter.php \Drupal\xautoload\Adapter\ClassFinderAdapter::addNamespacePsr0()
Add PSR-0 style namespace. This will assume that we are really dealing with a namespace, even if it has no '\\' included.
Parameters
string $prefix:
string[]|string $paths:
Overrides CommonRegistrationInterface::addNamespacePsr0
File
- lib/
Adapter/ ClassFinderAdapter.php, line 237
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 addNamespacePsr0($prefix, $paths) {
$logical_base_path = Util::namespaceLogicalPath($prefix);
foreach ((array) $paths as $root_path) {
$deep_path = strlen($root_path) ? rtrim($root_path, '/') . '/' . $logical_base_path : $logical_base_path;
$this->namespaceMap
->registerDeepPath($logical_base_path, $deep_path, $this->psr0Behavior);
}
}