Commit 789cd65d authored by catch's avatar catch
Browse files

Issue #3126003 by tedbow, alexpott, pfrenssen, lauriii: Increased memory usage during install

(cherry picked from commit df1d6896)
parent 5ca020f1
......@@ -522,7 +522,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
......
......@@ -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.
*
......@@ -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;
}
/**
......@@ -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.
......@@ -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');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment