summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-03-13 23:10:36 (GMT)
committerAlex Pott2015-03-13 23:10:36 (GMT)
commita01453a726b76f709f56658d179cfea6560fb165 (patch)
tree2861de1d6c67cc365bfe406aceb59689163c1928
parent5a58ba9f6b177bb387110df5fd57b43f8c1a4533 (diff)
Issue #2367747 by Palashvijay4O, andypost, Alienpruts, Cottser, er.pushpinderrana, gaurav.pahuja, pfrenssen, rpayanm, vadim.hirbu: Remove usage of system_rebuild_theme_data()
-rw-r--r--core/includes/bootstrap.inc3
-rw-r--r--core/includes/theme.maintenance.inc7
-rw-r--r--core/includes/update.inc2
-rw-r--r--core/lib/Drupal/Core/Updater/Theme.php2
-rw-r--r--core/modules/locale/locale.compare.inc2
-rw-r--r--core/modules/system/src/Tests/Extension/ModuleHandlerTest.php2
-rw-r--r--core/modules/system/system.module2
-rw-r--r--core/modules/update/src/Tests/UpdateContribTest.php2
-rw-r--r--core/modules/update/src/UpdateManager.php15
-rw-r--r--core/modules/update/update.services.yml2
10 files changed, 22 insertions, 17 deletions
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 89da4b7..45af368 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -236,7 +236,8 @@ function drupal_get_filename($type, $name, $filename = NULL) {
}
}
// If still unknown, retrieve the file list prepared in state by
- // system_rebuild_module_data() and system_rebuild_theme_data().
+ // system_rebuild_module_data() and
+ // \Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData().
if (!isset($files[$type][$name]) && \Drupal::hasService('state')) {
$files[$type] += \Drupal::state()->get('system.' . $type . '.files', array());
}
diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index 861ed7d..d63ce1b 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -62,13 +62,6 @@ function _drupal_maintenance_theme() {
}
}
- // Ensure that system.module is loaded.
- if (!function_exists('system_rebuild_theme_data')) {
- $module_handler = \Drupal::moduleHandler();
- $module_handler->addModule('system', 'core/modules/system');
- $module_handler->load('system');
- }
-
$themes = \Drupal::service('theme_handler')->listInfo();
// If no themes are installed yet, or if the requested custom theme is not
diff --git a/core/includes/update.inc b/core/includes/update.inc
index b5c60b3..ee3d66c 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -44,7 +44,7 @@ function update_check_incompatibility($name, $type = 'module') {
// We need to do a full rebuild here to make sure the database reflects any
// code changes that were made in the filesystem before the update script
// was initiated.
- $themes = system_rebuild_theme_data();
+ $themes = \Drupal::service('theme_handler')->rebuildThemeData();
$modules = system_rebuild_module_data();
}
diff --git a/core/lib/Drupal/Core/Updater/Theme.php b/core/lib/Drupal/Core/Updater/Theme.php
index b379325..ea853c8 100644
--- a/core/lib/Drupal/Core/Updater/Theme.php
+++ b/core/lib/Drupal/Core/Updater/Theme.php
@@ -76,7 +76,7 @@ class Theme extends Updater implements UpdaterInterface {
public function postInstall() {
// Update the theme info.
clearstatcache();
- system_rebuild_theme_data();
+ \Drupal::service('theme_handler')->rebuildThemeData();
}
/**
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index e131d99..efefa3b 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -126,7 +126,7 @@ function locale_translation_project_list() {
'interface translation server pattern',
);
$module_data = _locale_translation_prepare_project_list(system_rebuild_module_data(), 'module');
- $theme_data = _locale_translation_prepare_project_list(system_rebuild_theme_data(), 'theme');
+ $theme_data = _locale_translation_prepare_project_list(\Drupal::service('theme_handler')->rebuildThemeData(), 'theme');
$project_info = new ProjectInfo();
$project_info->processInfoList($projects, $module_data, 'module', TRUE, $additional_whitelist);
$project_info->processInfoList($projects, $theme_data, 'theme', TRUE, $additional_whitelist);
diff --git a/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php b/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
index 130ffd2..d2d6fed 100644
--- a/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
+++ b/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
@@ -295,7 +295,7 @@ class ModuleHandlerTest extends KernelTestBase {
*/
function testThemeMetaData() {
// Generate the list of available themes.
- $themes = system_rebuild_theme_data();
+ $themes = \Drupal::service('theme_handler')->rebuildThemeData();
// Check that the mtime field exists for the bartik theme.
$this->assertTrue(!empty($themes['bartik']->info['mtime']), 'The bartik.info.yml file modification time field is present.');
// Use 0 if mtime isn't present, to avoid an array index notice.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index d73ba63..f784b3f 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -849,7 +849,7 @@ function system_check_directory($form_element, FormStateInterface $form_state) {
* array is returned.
*
* @see system_rebuild_module_data()
- * @see system_rebuild_theme_data()
+ * @see \Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData()
*/
function system_get_info($type, $name = NULL) {
$info = array();
diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php
index 77f7b9b..dde3e52 100644
--- a/core/modules/update/src/Tests/UpdateContribTest.php
+++ b/core/modules/update/src/Tests/UpdateContribTest.php
@@ -293,7 +293,7 @@ class UpdateContribTest extends UpdateTestBase {
);
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$projects = update_get_projects();
- $theme_data = system_rebuild_theme_data();
+ $theme_data = \Drupal::service('theme_handler')->rebuildThemeData();
$project_info = new ProjectInfo();
$project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
diff --git a/core/modules/update/src/UpdateManager.php b/core/modules/update/src/UpdateManager.php
index 0652430..b92251b 100644
--- a/core/modules/update/src/UpdateManager.php
+++ b/core/modules/update/src/UpdateManager.php
@@ -9,6 +9,7 @@ namespace Drupal\update;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
@@ -64,6 +65,13 @@ class UpdateManager implements UpdateManagerInterface {
protected $availableReleasesTempStore;
/**
+ * The theme handler.
+ *
+ * @var \Drupal\Core\Extension\ThemeHandlerInterface
+ */
+ protected $themeHandler;
+
+ /**
* Constructs a UpdateManager.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
@@ -76,13 +84,16 @@ class UpdateManager implements UpdateManagerInterface {
* The translation service.
* @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_expirable_factory
* The expirable key/value factory.
+ * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
+ * The theme handler.
*/
- public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory) {
+ public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory, ThemeHandlerInterface $theme_handler) {
$this->updateSettings = $config_factory->get('update.settings');
$this->moduleHandler = $module_handler;
$this->updateProcessor = $update_processor;
$this->stringTranslation = $translation;
$this->keyValueStore = $key_value_expirable_factory->get('update');
+ $this->themeHandler = $theme_handler;
$this->availableReleasesTempStore = $key_value_expirable_factory->get('update_available_releases');
$this->projects = array();
}
@@ -123,7 +134,7 @@ class UpdateManager implements UpdateManagerInterface {
if (empty($this->projects)) {
// Still empty, so we have to rebuild.
$module_data = system_rebuild_module_data();
- $theme_data = system_rebuild_theme_data();
+ $theme_data = $this->themeHandler->rebuildThemeData();
$project_info = new ProjectInfo();
$project_info->processInfoList($this->projects, $module_data, 'module', TRUE);
$project_info->processInfoList($this->projects, $theme_data, 'theme', TRUE);
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index fe01f47..c14b8cc 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -6,7 +6,7 @@ services:
- { name: access_check, applies_to: _access_update_manager }
update.manager:
class: Drupal\update\UpdateManager
- arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable']
+ arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable', '@theme_handler']
update.processor:
class: Drupal\update\UpdateProcessor
arguments: ['@config.factory', '@queue', '@update.fetcher', '@state', '@private_key', '@keyvalue', '@keyvalue.expirable']