You are here

function WildcardFileFinder::addDrupalPaths in X Autoload 7.5

Same name and namespace in other branches
  1. 7.4 lib/Discovery/WildcardFileFinder.php \Drupal\xautoload\Discovery\WildcardFileFinder::addDrupalPaths()

Parameters

array $paths: Array keys are file paths or wildcard file paths.

File

src/Discovery/WildcardFileFinder.php, line 31

Class

WildcardFileFinder
Scan directories for wildcard files[] instructions in a module's info file.

Namespace

Drupal\xautoload\Discovery

Code

function addDrupalPaths(array $paths) {
  foreach ($paths as $path => $value) {
    if (1 && FALSE !== strpos($path, '*') && preg_match('#^([^\\*]*)/(.*\\*.*)$#', $path, $m)) {

      // Resolve wildcards.
      $this->value = $value;
      list(, $base, $wildcard) = $m;
      $this
        ->scanDirectory($base, $wildcard);
    }
    else {

      // Register the file directly.
      $this->files[$path] = $value;
    }
  }
}