function ExtensionList::reset

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::reset()
  2. 8.9.x core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::reset()
  3. 11.x core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::reset()

Resets the stored extension list.

We don't reset statically added filenames, as it is a static cache which logically can't change. This is done for performance reasons of the installer.

Return value

$this

1 call to ExtensionList::reset()
ThemeExtensionList::reset in core/lib/Drupal/Core/Extension/ThemeExtensionList.php
Resets the stored extension list.
1 method overrides ExtensionList::reset()
ThemeExtensionList::reset in core/lib/Drupal/Core/Extension/ThemeExtensionList.php
Resets the stored extension list.

File

core/lib/Drupal/Core/Extension/ExtensionList.php, line 165

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function reset() {
    $this->extensions = NULL;
    $this->cache
        ->delete($this->getListCacheId());
    $this->extensionInfo = NULL;
    $this->cache
        ->delete($this->getInfoCacheId());
    $this->pathNames = NULL;
    try {
        $this->state
            ->delete($this->getPathNamesCacheId());
    } catch (DatabaseExceptionWrapper $e) {
        // Ignore exceptions caused by a non existing {key_value} table in the
        // early installer.
    }
    // @todo In the long run it would be great to add the reset, but the early
    //   installer fails due to that. https://www.drupal.org/node/2719315 could
    //   help to resolve with that.
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.