You are here

public function ThemeHandler::refreshInfo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/ThemeHandler.php \Drupal\Core\Extension\ThemeHandler::refreshInfo()

Refreshes the theme info data of currently installed themes.

Modules can alter theme info, so this is typically called after a module has been installed or uninstalled.

Overrides ThemeHandlerInterface::refreshInfo

1 call to ThemeHandler::refreshInfo()
ThemeHandler::listInfo in core/lib/Drupal/Core/Extension/ThemeHandler.php
Returns a list of currently installed themes.

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 218
Contains \Drupal\Core\Extension\ThemeHandler.

Class

ThemeHandler
Default theme handler using the config system to store installation statuses.

Namespace

Drupal\Core\Extension

Code

public function refreshInfo() {
  $this
    ->reset();
  $extension_config = $this->configFactory
    ->get('core.extension');
  $installed = $extension_config
    ->get('theme');

  // @todo Avoid re-scanning all themes by retaining the original (unaltered)
  //   theme info somewhere.
  $list = $this
    ->rebuildThemeData();
  foreach ($list as $name => $theme) {
    if (isset($installed[$name])) {
      $this
        ->addTheme($theme);
    }
  }
  $this->state
    ->set('system.theme.data', $this->list);
}