You are here

function LocalDirectoryAdapter::addPearFlat in X Autoload 7.5

Adds a prefix similar to PEAR, but with flat directories.

This will assume with no further checks that $prefix contains no namespace separator.

Parameters

string $prefix: The prefix, e.g. 'Acme_FooPackage_'

string|string[] $paths: An array of paths, or one specific path. E.g. 'lib' for $relative = TRUE, or 'sites/all/libraries/AcmeFooPackage/lib' for $relative = FALSE.

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

Overrides CommonRegistrationInterface::addPearFlat

File

src/Adapter/LocalDirectoryAdapter.php, line 241

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 addPearFlat($prefix, $paths, $relative = TRUE) {
  $relative && $this
    ->prependToPaths($paths);
  $this->master
    ->addPearFlat($prefix, $paths);
}