protected function WildcardFileFinder::scanDirectoryLevel in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/Discovery/WildcardFileFinder.php \Drupal\xautoload\Discovery\WildcardFileFinder::scanDirectoryLevel()
Parameters
string $dir: Base directory, not containing any wildcard.
string $fragment: Wildcard path fragment to be processed now. This is never '**', but it always contains at least one asterisk.
null $remaining: Optional rest of the wildcard string, that may contain path fragments to be processed later.
Throws
\Exception
1 call to WildcardFileFinder::scanDirectoryLevel()
- WildcardFileFinder::scanDirectory in lib/
Discovery/ WildcardFileFinder.php
File
- lib/
Discovery/ WildcardFileFinder.php, line 147
Class
- WildcardFileFinder
- Scan directories for wildcard files[] instructions in a module's info file.
Namespace
Drupal\xautoload\DiscoveryCode
protected function scanDirectoryLevel($dir, $fragment, $remaining = NULL) {
if (!is_dir($dir)) {
return;
}
if ('**' === $fragment) {
throw new \Exception("Fragment must not be '**'.");
}
foreach (scandir($dir) as $candidate) {
if (!$this
->validateCandidate($candidate, $fragment)) {
continue;
}
if (!isset($remaining)) {
$this
->suggestFile($dir . '/' . $candidate);
}
else {
$this
->scanDirectory($dir . '/' . $candidate, $remaining);
}
}
}