diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index b4c731da3c..734d67ee74 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -135,6 +135,7 @@ function install_drupal($class_loader, $settings = []) { $state = $install_state; if (!empty($install_state['installation_finished'])) { unset($GLOBALS['install_state']); + unset($GLOBALS['conf']['container_service_providers']['InstallerServiceProvider']); } // All available tasks for this page request are now complete. Interactive diff --git a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php index 427a1cd39a..dd4ae5f470 100644 --- a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php +++ b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php @@ -14,16 +14,12 @@ * $conf['container_service_providers'] and required to prevent various services * from trying to retrieve data from storages that do not exist yet. */ -class InstallerServiceProvider extends NormalInstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { +class InstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { /** * {@inheritdoc} */ public function register(ContainerBuilder $container) { - // Do nothing if installation is finisihed. - if (!$this->isInstalling()) { - return; - } // Inject the special configuration storage for the installer. // This special implementation MUST NOT be used anywhere else than the early // installer environment. @@ -72,10 +68,6 @@ public function register(ContainerBuilder $container) { * {@inheritdoc} */ public function alter(ContainerBuilder $container) { - // Do nothing if installation is finisihed. - if (!$this->isInstalling()) { - return; - } // Disable Twig cache (php storage does not exist yet). $twig_config = $container->getParameter('twig.config'); $twig_config['cache'] = FALSE; diff --git a/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php b/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php index 6181641027..c63b2d864f 100644 --- a/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php +++ b/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php @@ -14,23 +14,8 @@ class NormalInstallerServiceProvider implements ServiceProviderInterface { * {@inheritdoc} */ public function register(ContainerBuilder $container) { - if ($this->isInstalling()) { - // Use a performance optimised module extension list. - $container->getDefinition('extension.list.module') - ->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); - } - } - - /** - * Returns TRUE if a Drupal installation is currently being attempted. - * - * This is used to ensure that installer service providers do not affect the - * container once Drupal is installed. - * - * @return bool - */ - protected function isInstalling() { - return drupal_installation_attempted(); + // Use a performance optimised module extension list. + $container->getDefinition('extension.list.module')->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); } }