class TomeStaticServiceProvider in Tome 8
Registers services in the container.
@internal
Hierarchy
- class \Drupal\tome_static\TomeStaticServiceProvider implements ServiceProviderInterface
Expanded class hierarchy of TomeStaticServiceProvider
File
- modules/
tome_static/ src/ TomeStaticServiceProvider.php, line 20
Namespace
Drupal\tome_staticView source
class TomeStaticServiceProvider implements ServiceProviderInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
$modules = $container
->getParameter('container.modules');
if (isset($modules['language'])) {
$container
->register('tome_static.language_path_subscriber', LanguagePathSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('config.factory'))
->addArgument(new Reference('language_manager'));
}
if (isset($modules['redirect'])) {
$container
->register('tome_static.redirect_path_subscriber', RedirectPathSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('entity_type.manager'))
->addArgument(new Reference('language_manager'));
}
if (isset($modules['dynamic_page_cache'])) {
$container
->register('tome_static.dynamic_page_cache_request_policy', DynamicRequestPolicy::class)
->setDecoratedService('dynamic_page_cache_request_policy');
}
if (isset($modules['page_cache'])) {
$container
->setDefinition('tome_static.http_middleware.page_cache', new ChildDefinition('http_middleware.page_cache'))
->setClass(ResettablePageCache::class)
->setDecoratedService('http_middleware.page_cache');
$container
->register('tome_static.page_cache_request_prepare_subscriber', PageCacheRequestPrepareSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('http_middleware.page_cache'));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TomeStaticServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |