You are here

public function UserServiceProvider::alter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/UserServiceProvider.php \Drupal\user\UserServiceProvider::alter()

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceModifierInterface::alter

File

core/modules/user/src/UserServiceProvider.php, line 25
Contains \Drupal\user\UserServiceProvider.

Class

UserServiceProvider
Swaps the original 'password' service in order to handle password hashing for user migrations that have passwords hashed to MD5.

Namespace

Drupal\user

Code

public function alter(ContainerBuilder $container) {
  $container
    ->setDefinition('password_original', $container
    ->getDefinition('password'));
  $container
    ->setDefinition('password', $container
    ->getDefinition('password_migrate'));
}