You are here

function ClassFinder::registerNamespaceDeepLocation in X Autoload 7.4

Same name and namespace in other branches
  1. 7.5 src/ClassFinder/ClassFinder.php \Drupal\xautoload\ClassFinder\ClassFinder::registerNamespaceDeepLocation()

Register a deep filesystem location for a given namespace.

Parameters

string $namespace: The namespace, e.g. "My\Namespace"

string $path: The deep path, e.g. "../lib/My/Namespace"

DirectoryBehaviorInterface $behavior: If TRUE, then we are not sure if the directory at $path actually exists. If during the process we find the directory to be nonexistent, we unregister the path.

Overrides ExtendedClassFinderInterface::registerNamespaceDeepLocation

File

lib/ClassFinder/ClassFinder.php, line 355

Class

ClassFinder

Namespace

Drupal\xautoload\ClassFinder

Code

function registerNamespaceDeepLocation($namespace, $path, $behavior = NULL) {
  if (!isset($behavior)) {
    $behavior = $this->defaultBehavior;
  }
  $namespace_path_fragment = Util::namespaceLogicalPath($namespace);
  $deep_path = strlen($path) ? $path . '/' : '';
  $this->namespaceMap
    ->registerDeepPath($namespace_path_fragment, $deep_path, $behavior);
}