You are here

function LanguageNegotiator::purgeConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::purgeConfiguration()

Resave the configuration to purge missing negotiation methods.

Overrides LanguageNegotiatorInterface::purgeConfiguration

File

core/modules/language/src/LanguageNegotiator.php, line 282
Contains \Drupal\language\LanguageNegotiator.

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

function purgeConfiguration() {

  // Ensure that we are getting the defined language negotiation information.
  // An invocation of \Drupal\Core\Extension\ModuleHandler::install() or
  // \Drupal\Core\Extension\ModuleHandler::uninstall() could invalidate the
  // cached information.
  $this->negotiatorManager
    ->clearCachedDefinitions();
  $this->languageManager
    ->reset();
  foreach ($this->languageManager
    ->getDefinedLanguageTypesInfo() as $type => $info) {
    $this
      ->saveConfiguration($type, $this
      ->getEnabledNegotiators($type));
  }
}