You are here

function ClassFinder::registerPrefixDeepLocation in X Autoload 7.4

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

Register a filesystem location for a given class prefix.

Parameters

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

string $deep_path: The deep filesystem location, e.g. "../lib/My/Prefix".

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::registerPrefixDeepLocation

1 call to ClassFinder::registerPrefixDeepLocation()
ClassFinder::registerPrefixDeep in lib/ClassFinder/ClassFinder.php
Register a PEAR-style deep path for a given class prefix.

File

lib/ClassFinder/ClassFinder.php, line 266

Class

ClassFinder

Namespace

Drupal\xautoload\ClassFinder

Code

function registerPrefixDeepLocation($prefix, $deep_path, $behavior = NULL) {
  if (!isset($behavior)) {
    $behavior = $this->defaultBehavior;
  }
  $logical_base_path = Util::prefixLogicalPath($prefix);
  $deep_path = strlen($deep_path) ? rtrim($deep_path, '/') . '/' : '';
  $this->prefixMap
    ->registerDeepPath($logical_base_path, $deep_path, $behavior);
}