You are here

public function RestrictIpServiceProvider::register in Restrict IP 3.x

Same name and namespace in other branches
  1. 8.2 src/RestrictIpServiceProvider.php \Drupal\restrict_ip\RestrictIpServiceProvider::register()

*

Overrides ServiceProviderInterface::register

File

src/RestrictIpServiceProvider.php, line 14

Class

RestrictIpServiceProvider

Namespace

Drupal\restrict_ip

Code

public function register(ContainerBuilder $container) {
  $modules = $container
    ->getParameter('container.modules');
  if (isset($modules['ip2country'])) {
    $definition = $container
      ->getDefinition('restrict_ip.service');
    $definition
      ->addArgument(new Reference('user.data'));
  }
}