LanguageNegotiator::purgeConfiguration

LanguageNegotiator::purgeConfiguration()

Resave the configuration to purge missing negotiation methods.

Overrides LanguageNegotiatorInterface::purgeConfiguration

File

core/modules/language/src/LanguageNegotiator.php, line 277

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\ModuleInstaller::install() or
  // \Drupal\Core\Extension\ModuleInstaller::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));
  }
}
doc_Drupal
2016-10-29 09:22:53
Comments
Leave a Comment

Please login to continue.