diff --git a/core/includes/theme.inc b/core/includes/theme.inc index fea4464..a34a242 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -693,6 +693,8 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) { * the themes' machine names, and the values are the themes' human-readable * names. This element is not set if there are no themes on the system that * declare this theme as their base theme. + * + * @deprecated as of Drupal 8.0. Use \Drupal::service('theme_handler')->listInfo(). */ function list_themes($refresh = FALSE) { /** @var \Drupal\Core\Theme\ThemeHandler $theme_handler */ @@ -720,6 +722,8 @@ function list_themes($refresh = FALSE) { * @return * Returns an array of all of the theme's ancestors; the first element's value * will be NULL if an error occurred. + * + * @deprecated as of Drupal 8.0. Use \Drupal::service('theme_handler')->getBaseThemes(). */ function drupal_find_base_themes($themes, $key) { return \Drupal::service('theme_handler')->getBaseThemes($themes, $key); @@ -1410,6 +1414,8 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config) * * @param $theme_list * An array of theme names. + * + * @deprecated as of Drupal 8.0. Use \Drupal::service('theme_handler')->enable(). */ function theme_enable($theme_list) { \Drupal::service('theme_handler')->enable($theme_list); @@ -1420,6 +1426,8 @@ function theme_enable($theme_list) { * * @param $theme_list * An array of theme names. + * + * @deprecated as of Drupal 8.0. Use \Drupal::service('theme_handler')->disable(). */ function theme_disable($theme_list) { \Drupal::service('theme_handler')->disable($theme_list); diff --git a/core/lib/Drupal/Core/Theme/ThemeHandler.php b/core/lib/Drupal/Core/Theme/ThemeHandler.php index 8adea15..d668eb7 100644 --- a/core/lib/Drupal/Core/Theme/ThemeHandler.php +++ b/core/lib/Drupal/Core/Theme/ThemeHandler.php @@ -13,7 +13,6 @@ use Drupal\Core\Extension\ExtensionNameLengthException; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Routing\RouteBuilder; -use Drupal\Core\SystemListing; use Drupal\Core\SystemListingInfo; use Drupal\Core\Extension\InfoParserInterface; @@ -39,6 +38,11 @@ class ThemeHandler implements ThemeHandlerInterface { 'secondary_menu', ); + /** + * A list of all currently available themes. + * + * @var array + */ protected $list = array(); /** @@ -178,8 +182,7 @@ public function disable(array $theme_list) { public function listInfo() { if (empty($this->list)) { $this->list = array(); - // Extract from the database only when it is available. - // Also check that the site is not in the middle of an install or update. + // Check that the site is not in the middle of an install or update. if (!defined('MAINTENANCE_MODE')) { try { $themes = $this->systemThemeList();