class SubpathautoServiceProvider in Sub-pathauto (Sub-path URL Aliases) 8
Defines a service provider for the Subpathauto module.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\subpathauto\SubpathautoServiceProvider
Expanded class hierarchy of SubpathautoServiceProvider
File
- src/
SubpathautoServiceProvider.php, line 12
Namespace
Drupal\subpathautoView source
class SubpathautoServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
// The alias-based processor requires the path_alias entity schema to be
// installed, so we prevent it from being registered to the path processor
// manager. We do this by removing the tags that the compiler pass looks
// for. This means that the URL generator can safely be used during the
// database update process.
if ($container
->get('kernel') instanceof UpdateKernel && $container
->hasDefinition('path_processor_subpathauto')) {
$container
->getDefinition('path_processor_subpathauto')
->clearTag('path_processor_inbound')
->clearTag('path_processor_outbound');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |
SubpathautoServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |