function _theme_load_registry

Get the theme_registry cache; if it doesn't exist, build it.

Parameters

$theme: The loaded $theme object as returned by list_themes().

$base_theme: An array of loaded $theme objects representing the ancestor themes in oldest first order.

$theme_engine: The name of the theme engine.

$complete: Whether to load the complete theme registry or an instance of the Drupal\Core\Utility\ThemeRegistry class.

Return value

The theme registry array, or an instance of the Drupal\Core\Utility\ThemeRegistry class.

1 call to _theme_load_registry()
DisplayPluginBase::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default form for setting options.

File

drupal/core/includes/theme.inc, line 323
The theme system, which controls the output of Drupal.

Code

function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL, $complete = TRUE) {
  if ($complete) {

    // Check the theme registry cache; if it exists, use it.
    $cached = cache()
      ->get("theme_registry:{$theme->name}");
    if (isset($cached->data)) {
      $registry = $cached->data;
    }
    else {

      // If not, build one and cache it.
      $registry = _theme_build_registry($theme, $base_theme, $theme_engine);

      // Only persist this registry if all modules are loaded. This assures a
      // complete set of theme hooks.
      if (module_load_all(NULL)) {
        _theme_save_registry($theme, $registry);
      }
    }
    return $registry;
  }
  else {
    return new ThemeRegistry('theme_registry:runtime:' . $theme->name, 'cache', array(
      'theme_registry' => TRUE,
    ));
  }
}