Issue #3254616: Update Composer Stager to 0.3.0
Merge request reports
Activity
- Resolved by Adam G-H
- Resolved by Adam G-H
- Resolved by Ted Bowman
77 79 * 78 * @param \Drupal\package_manager\Event\PreApplyEvent $event 80 * This should only be used for paths that, if they exist at all, are 81 * *guaranteed* to exist within the web root. 82 * 83 * @param \Drupal\package_manager\Event\PreCreateEvent|\Drupal\package_manager\Event\PreApplyEvent $event 79 84 * The event object. 85 * @param string[] $paths 86 * The paths to exclude. These should be relative to the web root, and will 87 * be made relative to the project root. 80 88 */ 81 public function preApply(PreApplyEvent $event): void { 82 // Don't copy anything from the staging area's sites/default. 83 // @todo Make this a lot smarter in https://www.drupal.org/i/3228955. 84 $event->excludePath('sites/default'); 89 protected function excludeInWebRoot(StageEvent $event, array $paths): void { I wonder if it would make sense to add
Stage::getPathLocator()
I think this would make a lot of the subscribers simpler because they could do
$event->getStage()->getPathLocator()->getWebRoot()
and the these methods could be moved toExcludedPathsTrait
also this would eliminate the potential problem(though edge case) of some custom module altering a service of a class that extends
Stage
, likeautomatic_updates.updater
, and providing a different service, saymy_module.custom_path_locator
that extendsPathLocator
instead ofpackage_manager.path_locator
. Currently if any module did that all of our subscribers would be still be usingpackage_manager.path_locator
notmy_module.custom_path_locator
. So subscribers and stage would using different path locators which could be very bad.If we added
Stage::getPathLocator()
all validators could be guaranteed to get the same path locator as the stage itself is using.