Loading core/lib/Drupal/Core/Installer/InstallerServiceProvider.php +2 −15 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * $conf['container_service_providers'] and required to prevent various services * from trying to retrieve data from storages that do not exist yet. */ class InstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { class InstallerServiceProvider extends NormalInstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { /** * {@inheritdoc} Loading @@ -26,18 +26,12 @@ public function register(ContainerBuilder $container) { $container->register('config.storage', 'Drupal\Core\Config\InstallStorage'); // Replace services with in-memory implementations. $definition = $container->getDefinition('cache_factory'); $definition->setClass('Drupal\Core\Cache\MemoryBackendFactory'); $definition->setArguments([]); $definition->setMethodCalls([]); $container ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory'); $container ->register('keyvalue.expirable', 'Drupal\Core\KeyValueStore\KeyValueNullExpirableFactory'); // Replace services with no-op implementations. $container ->register('lock', 'Drupal\Core\Lock\NullLockBackend'); $container ->register('url_generator', 'Drupal\Core\Routing\NullGenerator') ->addArgument(new Reference('request_stack')); Loading @@ -46,12 +40,6 @@ public function register(ContainerBuilder $container) { $container ->register('router.dumper', 'Drupal\Core\Routing\NullMatcherDumper'); // Remove the cache tags invalidator tag from the cache tags storage, so // that we don't call it when cache tags are invalidated very early in the // installer. $container->getDefinition('cache_tags.invalidator.checksum') ->clearTag('cache_tags_invalidator'); // Replace the route builder with an empty implementation. // @todo Convert installer steps into routes; add an installer.routing.yml. $definition = $container->getDefinition('router.builder'); Loading @@ -60,8 +48,7 @@ public function register(ContainerBuilder $container) { // we don't need to ship with a custom proxy class. ->setLazy(FALSE); // Use a performance optimised module extension list. $container->getDefinition('extension.list.module')->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); parent::register($container); } /** Loading core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php +36 −5 Original line number Diff line number Diff line Loading @@ -2,11 +2,23 @@ namespace Drupal\Core\Installer; use Drupal\Core\Cache\MemoryBackendFactory; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderInterface; use Drupal\Core\Lock\NullLockBackend; /** * Service provider for the non early installer environment. * Service provider for the installer environment. * * This class is manually added by install_begin_request() via * $conf['container_service_providers'] and optimizes the container for * installation. * * Note that the early installer environment requires the further customisations * in InstallerServiceProvider. * * @see install_begin_request() * @see \Drupal\Core\Installer\InstallerServiceProvider */ class NormalInstallerServiceProvider implements ServiceProviderInterface { Loading @@ -14,10 +26,29 @@ class NormalInstallerServiceProvider implements ServiceProviderInterface { * {@inheritdoc} */ public function register(ContainerBuilder $container) { // Use a performance optimised module extension list. $container->getDefinition('extension.list.module')->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); $container->getDefinition('extension.list.theme')->setClass('Drupal\Core\Installer\InstallerThemeExtensionList'); $container->getDefinition('extension.list.theme_engine')->setClass('Drupal\Core\Installer\InstallerThemeEngineExtensionList'); // Replace cache services with in-memory implementations. The results in // less queries to set caches which will only be cleared on the next module // install. $definition = $container->getDefinition('cache_factory'); $definition->setClass(MemoryBackendFactory::class); $definition->setArguments([]); $definition->setMethodCalls([]); // Replace lock service with no-op implementation as Drupal installation can // only occur in a single thread and the site should not be publicly // available. $container ->register('lock', NullLockBackend::class); // Remove the cache tags invalidator tag from the cache tags storage, so // that we don't call it when cache tags are invalidated in the installer. $container->getDefinition('cache_tags.invalidator.checksum') ->clearTag('cache_tags_invalidator'); // Use performance-optimized extension lists. $container->getDefinition('extension.list.module')->setClass(InstallerModuleExtensionList::class); $container->getDefinition('extension.list.theme')->setClass(InstallerThemeExtensionList::class); $container->getDefinition('extension.list.theme_engine')->setClass(InstallerThemeEngineExtensionList::class); } } Loading
core/lib/Drupal/Core/Installer/InstallerServiceProvider.php +2 −15 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * $conf['container_service_providers'] and required to prevent various services * from trying to retrieve data from storages that do not exist yet. */ class InstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { class InstallerServiceProvider extends NormalInstallerServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { /** * {@inheritdoc} Loading @@ -26,18 +26,12 @@ public function register(ContainerBuilder $container) { $container->register('config.storage', 'Drupal\Core\Config\InstallStorage'); // Replace services with in-memory implementations. $definition = $container->getDefinition('cache_factory'); $definition->setClass('Drupal\Core\Cache\MemoryBackendFactory'); $definition->setArguments([]); $definition->setMethodCalls([]); $container ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory'); $container ->register('keyvalue.expirable', 'Drupal\Core\KeyValueStore\KeyValueNullExpirableFactory'); // Replace services with no-op implementations. $container ->register('lock', 'Drupal\Core\Lock\NullLockBackend'); $container ->register('url_generator', 'Drupal\Core\Routing\NullGenerator') ->addArgument(new Reference('request_stack')); Loading @@ -46,12 +40,6 @@ public function register(ContainerBuilder $container) { $container ->register('router.dumper', 'Drupal\Core\Routing\NullMatcherDumper'); // Remove the cache tags invalidator tag from the cache tags storage, so // that we don't call it when cache tags are invalidated very early in the // installer. $container->getDefinition('cache_tags.invalidator.checksum') ->clearTag('cache_tags_invalidator'); // Replace the route builder with an empty implementation. // @todo Convert installer steps into routes; add an installer.routing.yml. $definition = $container->getDefinition('router.builder'); Loading @@ -60,8 +48,7 @@ public function register(ContainerBuilder $container) { // we don't need to ship with a custom proxy class. ->setLazy(FALSE); // Use a performance optimised module extension list. $container->getDefinition('extension.list.module')->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); parent::register($container); } /** Loading
core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php +36 −5 Original line number Diff line number Diff line Loading @@ -2,11 +2,23 @@ namespace Drupal\Core\Installer; use Drupal\Core\Cache\MemoryBackendFactory; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderInterface; use Drupal\Core\Lock\NullLockBackend; /** * Service provider for the non early installer environment. * Service provider for the installer environment. * * This class is manually added by install_begin_request() via * $conf['container_service_providers'] and optimizes the container for * installation. * * Note that the early installer environment requires the further customisations * in InstallerServiceProvider. * * @see install_begin_request() * @see \Drupal\Core\Installer\InstallerServiceProvider */ class NormalInstallerServiceProvider implements ServiceProviderInterface { Loading @@ -14,10 +26,29 @@ class NormalInstallerServiceProvider implements ServiceProviderInterface { * {@inheritdoc} */ public function register(ContainerBuilder $container) { // Use a performance optimised module extension list. $container->getDefinition('extension.list.module')->setClass('Drupal\Core\Installer\InstallerModuleExtensionList'); $container->getDefinition('extension.list.theme')->setClass('Drupal\Core\Installer\InstallerThemeExtensionList'); $container->getDefinition('extension.list.theme_engine')->setClass('Drupal\Core\Installer\InstallerThemeEngineExtensionList'); // Replace cache services with in-memory implementations. The results in // less queries to set caches which will only be cleared on the next module // install. $definition = $container->getDefinition('cache_factory'); $definition->setClass(MemoryBackendFactory::class); $definition->setArguments([]); $definition->setMethodCalls([]); // Replace lock service with no-op implementation as Drupal installation can // only occur in a single thread and the site should not be publicly // available. $container ->register('lock', NullLockBackend::class); // Remove the cache tags invalidator tag from the cache tags storage, so // that we don't call it when cache tags are invalidated in the installer. $container->getDefinition('cache_tags.invalidator.checksum') ->clearTag('cache_tags_invalidator'); // Use performance-optimized extension lists. $container->getDefinition('extension.list.module')->setClass(InstallerModuleExtensionList::class); $container->getDefinition('extension.list.theme')->setClass(InstallerThemeExtensionList::class); $container->getDefinition('extension.list.theme_engine')->setClass(InstallerThemeEngineExtensionList::class); } }