Skip to content
Snippets Groups Projects

Resolve #3408488 "Make unknownpathexcluder accept"

1 file
+ 3
4
Compare changes
  • Side-by-side
  • Inline
@@ -113,17 +113,16 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// glob() flags aren't supported on all systems. We also can't use
// \Drupal\Core\File\FileSystemInterface::scanDirectory(), because it
// unconditionally ignores hidden files and directories.
$unknown_paths = [];
$handle = opendir($project_root) ?: throw new \RuntimeException("Could not scan for files in the project root.");
while ($entry = readdir($handle)) {
if ($entry === '.' || $entry === '..' || in_array($entry, $known_paths, TRUE)) {
continue;
}
$unknown_paths[] = $entry;
// We can add the unknown path as-is, because it is relative to the
// project root.
$event->add($entry);
}
closedir($handle);
$event->addPathsRelativeToProjectRoot($unknown_paths);
}
/**
Loading