- Issue created by @Gábor Hojtsy
- Merge request !11208Add condition on project root, don't attempt to skip directories that we don't need to anyway. → (Open) created by Gábor Hojtsy
1. I have private files configured on an absolute path outside of the webroot (and even the project root).
2. This throws off SiteFilesExcluder, because it attempts to exclude public, private and asset files, but as part of that it also forces those to be under either the webroot (if relative paths) of the project root (if absolute paths).
/**
* Excludes public and private files from stage operations.
*
* @param \Drupal\package_manager\Event\CollectPathsToExcludeEvent $event
* The event object.
*/
public function excludeSiteFiles(CollectPathsToExcludeEvent $event): void {
// Exclude files handled by the stream wrappers listed in $this->wrappers.
// These paths could be either absolute or relative, depending on site
// settings. If they are absolute, treat them as relative to the project
// root. Otherwise, treat them as relative to the web root.
foreach ($this->wrappers as $scheme) {
$wrapper = $this->streamWrapperManager->getViaScheme($scheme);
if ($wrapper instanceof LocalStream) {
$path = $wrapper->getDirectoryPath();
if ($this->fileSystem->isAbsolutePath($path)) {
if ($path = realpath($path)) {
$event->addPathsRelativeToProjectRoot([$path]);
}
}
else {
$event->addPathsRelativeToWebRoot([$path]);
}
}
}
}
(exception is thrown from addPathsRelativeToProjectRoot() as the path is of course not inside the project root).
Have private files outside of the project root.
Since the files are attempted to be excluded anyway and they are at an entirely different place, they would be naturally excluded? So at this point, if something is outside of the area that is used for creating the stage, it should be just ignored I think? Wold that be "outside of the project root"?
Active
11.1 🔥
package_manager.module