Skip to content
Snippets Groups Projects

Resolve #3408488 "Make unknownpathexcluder accept"

1 file
+ 12
4
Compare changes
  • Side-by-side
  • Inline
@@ -80,7 +80,7 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// and that requires Composer commands to be able to run. This intentionally
// does not catch exceptions: failed Composer validation in the project root
// implies that this excluder cannot function correctly.
// Note: the call to ComposerInspector::getInstalledPackagesList() would
// Note: the call to ComposerInspector::getConfig() would
// also have triggered this, but explicitness is preferred here.
// @see \Drupal\package_manager\StatusCheckTrait::runStatusCheck()
$project_root = $this->pathLocator->getProjectRoot();
@@ -94,8 +94,15 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
$web_root,
'composer.json',
'composer.lock',
...$this->getScaffoldFiles(),
];
foreach ($this->getScaffoldFiles() as $scaffold_file_path) {
// The web root is always included in staging operations, so we don't need
// to do anything special for scaffold files that live in it.
if (str_starts_with($scaffold_file_path, '[web-root]')) {
continue;
}
$always_include[] = ltrim($scaffold_file_path, '/');
}
// Search for all files (including hidden ones) in the project root. We need
// to use readdir() and friends here, rather than glob(), since certain
@@ -119,8 +126,9 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
/**
* Gets the path of scaffold files, for example 'index.php' and 'robots.txt'.
*
* @return array
* The array of scaffold file paths.
* @return string[]
* The paths of scaffold files provided by `drupal/core`, relative to the
* project root.
*
* @todo Intelligently load scaffold files in https://drupal.org/i/3343802.
*/
Loading