function CollectPathsToExcludeEvent::addPathsRelativeToWebRoot

Flags paths to be ignored, relative to the web root.

This should only be used for paths that, if they exist at all, are *guaranteed* to exist within the web root.

Parameters

string[] $paths: The paths to ignore. These should be relative to the web root. They will be made relative to the project root.

File

core/modules/package_manager/src/Event/CollectPathsToExcludeEvent.php, line 69

Class

CollectPathsToExcludeEvent
Defines an event that collects paths to exclude.

Namespace

Drupal\package_manager\Event

Code

public function addPathsRelativeToWebRoot(array $paths) : void {
    $web_root = $this->pathLocator
        ->getWebRoot();
    if ($web_root) {
        $web_root .= '/';
    }
    foreach ($paths as $path) {
        // Make the path relative to the project root by prefixing the web root.
        $this->add($web_root . $path);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.