Skip to content
Snippets Groups Projects

Issue #3245996: Move basic exclusions and test coverage into Package Manager

Merged Issue #3245996: Move basic exclusions and test coverage into Package Manager
All threads resolved!
All threads resolved!
6 files
+ 69
20
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -2,7 +2,6 @@
namespace Drupal\package_manager\EventSubscriber;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\StreamWrapper\LocalStream;
use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface;
@@ -43,13 +42,6 @@ class ExcludedPathsSubscriber implements EventSubscriberInterface {
*/
protected $streamWrapperManager;
/**
* The module list service.
*
* @var \Drupal\Core\Extension\ModuleExtensionList
*/
protected $moduleList;
/**
* Constructs an UpdateSubscriber.
*
@@ -61,19 +53,16 @@ class ExcludedPathsSubscriber implements EventSubscriberInterface {
* The file system service.
* @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager
* The stream wrapper manager service.
* @param \Drupal\Core\Extension\ModuleExtensionList $module_list
* The module list service.
*/
public function __construct(string $app_root, string $site_path, FileSystemInterface $file_system, StreamWrapperManagerInterface $stream_wrapper_manager, ModuleExtensionList $module_list) {
public function __construct(string $app_root, string $site_path, FileSystemInterface $file_system, StreamWrapperManagerInterface $stream_wrapper_manager) {
$this->appRoot = $app_root;
$this->sitePath = $site_path;
$this->fileSystem = $file_system;
$this->streamWrapperManager = $stream_wrapper_manager;
$this->moduleList = $module_list;
}
/**
* Reacts before staged updates are committed the active directory.
* Reacts before staged changes are committed the active directory.
*
* @param \Drupal\package_manager\Event\PreApplyEvent $event
* The event object.
@@ -90,7 +79,7 @@ class ExcludedPathsSubscriber implements EventSubscriberInterface {
}
/**
* Reacts to the beginning of an update process.
* Excludes paths from a staging area before it is created.
*
* @param \Drupal\package_manager\Event\PreCreateEvent $event
* The event object.
@@ -111,11 +100,6 @@ class ExcludedPathsSubscriber implements EventSubscriberInterface {
if ($private = $this->getFilesPath('private')) {
$event->excludePath($private);
}
// If this module is a git clone, exclude it.
if (is_dir(__DIR__ . '/../../.git')) {
$dir = $this->moduleList->getPath('automatic_updates');
$event->excludePath($dir);
}
// Exclude site-specific settings files.
$settings_files = [
Loading