You are here

protected function LocalDirectoryAdapter::prependToPaths in X Autoload 7.5

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

Prepends $this->localDirectory to a number of paths.

Parameters

string|string[] &$paths:

8 calls to LocalDirectoryAdapter::prependToPaths()
LocalDirectoryAdapter::add in src/Adapter/LocalDirectoryAdapter.php
Adds a PSR-0 style prefix. Alias for ->addPsr0().
LocalDirectoryAdapter::addClassMap in src/Adapter/LocalDirectoryAdapter.php
Registers an array ("map") of classes to file paths.
LocalDirectoryAdapter::addClassmapSources in src/Adapter/LocalDirectoryAdapter.php
Adds source paths for classmap discovery.
LocalDirectoryAdapter::addNamespacePsr0 in src/Adapter/LocalDirectoryAdapter.php
Adds a PSR-0 style namespace.
LocalDirectoryAdapter::addPear in src/Adapter/LocalDirectoryAdapter.php
Adds a PEAR-like prefix.

... See full list

File

src/Adapter/LocalDirectoryAdapter.php, line 268

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

protected function prependToPaths(&$paths) {
  if (!is_array($paths)) {
    $paths = $this->localDirectory . $paths;
  }
  else {
    foreach ($paths as &$path) {
      $path = $this->localDirectory . $path;
    }
  }
}