Skip to content

Commit

Permalink
Issue #3126003 by tedbow, alexpott, pfrenssen, lauriii: Increased mem…
Browse files Browse the repository at this point in the history
…ory usage during install
  • Loading branch information
catch committed Apr 9, 2020
1 parent 28aba73 commit 013a249
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion core.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ services:
class: Drupal\Core\Extension\ModuleInstaller
tags:
- { name: service_collector, tag: 'module_install.uninstall_validator', call: addUninstallValidator }
arguments: ['@app.root', '@module_handler', '@kernel', '@extension.list.theme']
arguments: ['@app.root', '@module_handler', '@kernel']
lazy: true
extension.list.module:
class: Drupal\Core\Extension\ModuleExtensionList
Expand Down
19 changes: 2 additions & 17 deletions lib/Drupal/Core/Extension/ModuleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ class ModuleInstaller implements ModuleInstallerInterface {
*/
protected $uninstallValidators;

/**
* The theme extension list.
*
* @var \Drupal\Core\Extension\ThemeExtensionList
*/
protected $themeExtensionList;

/**
* Constructs a new ModuleInstaller instance.
*
Expand All @@ -66,21 +59,14 @@ class ModuleInstaller implements ModuleInstallerInterface {
* The module handler.
* @param \Drupal\Core\DrupalKernelInterface $kernel
* The drupal kernel.
* @param \Drupal\Core\Extension\ThemeExtensionList $extension_list_theme
* The theme extension list.
*
* @see \Drupal\Core\DrupalKernel
* @see \Drupal\Core\CoreServiceProvider
*/
public function __construct($root, ModuleHandlerInterface $module_handler, DrupalKernelInterface $kernel, ThemeExtensionList $extension_list_theme = NULL) {
public function __construct($root, ModuleHandlerInterface $module_handler, DrupalKernelInterface $kernel) {
$this->root = $root;
$this->moduleHandler = $module_handler;
$this->kernel = $kernel;
if (is_null($extension_list_theme)) {
@trigger_error('The extension.list.theme service must be passed to ' . __NAMESPACE__ . '\ModuleInstaller::__construct(). It was added in drupal:8.9.0 and will be required before drupal:10.0.0.', E_USER_DEPRECATED);
$extension_list_theme = \Drupal::service('extension.list.theme');
}
$this->themeExtensionList = $extension_list_theme;
}

/**
Expand Down Expand Up @@ -386,7 +372,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
}

if ($uninstall_dependents) {
$theme_list = $this->themeExtensionList->getList();
$theme_list = \Drupal::service('extension.list.theme')->getList();

// Add dependent modules to the list. The new modules will be processed as
// the foreach loop continues.
Expand Down Expand Up @@ -594,7 +580,6 @@ protected function updateKernel($module_filenames) {
// After rebuilding the container we need to update the injected
// dependencies.
$container = $this->kernel->getContainer();
$this->themeExtensionList = $container->get('extension.list.theme');
$this->moduleHandler = $container->get('module_handler');
}

Expand Down

0 comments on commit 013a249

Please sign in to comment.