NormalInstallerServiceProvider.php in Drupal 10
File
core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php
View source
<?php
namespace Drupal\Core\Installer;
use Drupal\Core\Cache\MemoryBackendFactory;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\Lock\NullLockBackend;
use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;
use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass;
use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass;
use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass;
use Symfony\Component\DependencyInjection\Compiler\ResolveHotPathPass;
use Symfony\Component\DependencyInjection\Reference;
class NormalInstallerServiceProvider implements ServiceProviderInterface {
public function register(ContainerBuilder $container) {
$definition = $container
->getDefinition('cache_factory');
$definition
->setClass(MemoryBackendFactory::class);
$definition
->setArguments([]);
$definition
->setMethodCalls([]);
$container
->register('lock', NullLockBackend::class);
$container
->getDefinition('cache_tags.invalidator.checksum')
->clearTag('cache_tags_invalidator');
$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);
if (get_called_class() === NormalInstallerServiceProvider::class) {
$lazy_route_provider = $container
->register('router.route_provider.installer');
$lazy_route_provider
->setClass(InstallerRouteProviderLazyBuilder::class)
->setDecoratedService('router.route_provider')
->addArgument(new Reference('router.route_provider.installer.inner'))
->addArgument(new Reference('router.builder'))
->addTag('event_subscriber');
}
$pass_config = $container
->getCompilerPassConfig();
$pass_config
->setRemovingPasses(array_filter($pass_config
->getRemovingPasses(), function ($pass) {
return !($pass instanceof InlineServiceDefinitionsPass || $pass instanceof RemoveUnusedDefinitionsPass || $pass instanceof AnalyzeServiceReferencesPass || $pass instanceof ReplaceAliasByActualDefinitionPass);
}));
$pass_config
->setAfterRemovingPasses(array_filter($pass_config
->getAfterRemovingPasses(), function ($pass) {
return !$pass instanceof ResolveHotPathPass;
}));
}
}