You are here

function LocalDirectoryAdapter::composerDir in X Autoload 7.5

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

Scans a directory containing Composer-generated autoload files.

Parameters

string $dir: Directory to look for Composer-generated files. Typically this is the ../vendor/composer dir.

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

Overrides ClassFinderAdapterInterface::composerDir

File

src/Adapter/LocalDirectoryAdapter.php, line 93

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 composerDir($dir, $relative = TRUE) {
  $relative && ($dir = $this->localDirectory . $dir);
  $dir = ComposerDir::create($dir);
  $dir
    ->writeToAdapter($this->master);
}