You are here

function LocalDirectoryAdapter::addClassmapSources in X Autoload 7.5

Same name and namespace in other branches
  1. 7.4 lib/Adapter/LocalDirectoryAdapter.php \Drupal\xautoload\Adapter\LocalDirectoryAdapter::addClassmapSources()

Adds source paths for classmap discovery.

The classmap for each source will be cached between requests. A "clear all caches" will trigger a rescan.

Parameters

string[] $paths: File paths or wildcard paths for class discovery.

bool $relative: If TRUE, the paths will be relative to $this->localDirectory.

Overrides ClassFinderAdapterInterface::addClassmapSources

File

src/Adapter/LocalDirectoryAdapter.php, line 61

Class

LocalDirectoryAdapter
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\Adapter

Code

function addClassmapSources($paths, $relative = TRUE) {
  $relative && $this
    ->prependToPaths($paths);
  $this->master
    ->addClassmapSources($paths);
}