Commit d189ff05 authored by catch's avatar catch

Revert "Issue #2761403 by Berdir: Move runtime theme registry into bootstrap cache"

This reverts commit 4a95e650.
parent 790c021d
...@@ -1408,7 +1408,7 @@ services: ...@@ -1408,7 +1408,7 @@ services:
arguments: ['@app.root', '@theme_handler', '@cache.bootstrap', '@module_handler'] arguments: ['@app.root', '@theme_handler', '@cache.bootstrap', '@module_handler']
theme.registry: theme.registry:
class: Drupal\Core\Theme\Registry class: Drupal\Core\Theme\Registry
arguments: ['@app.root', '@cache.default', '@lock', '@module_handler', '@theme_handler', '@theme.initialization', null, '@cache.bootstrap'] arguments: ['@app.root', '@cache.default', '@lock', '@module_handler', '@theme_handler', '@theme.initialization']
tags: tags:
- { name: needs_destruction } - { name: needs_destruction }
calls: calls:
......
...@@ -140,13 +140,6 @@ class Registry implements DestructableInterface { ...@@ -140,13 +140,6 @@ class Registry implements DestructableInterface {
*/ */
protected $themeManager; protected $themeManager;
/**
* The runtime cache.
*
* @var \Drupal\Core\Cache\CacheBackendInterface
*/
protected $runtimeCache;
/** /**
* Constructs a \Drupal\Core\Theme\Registry object. * Constructs a \Drupal\Core\Theme\Registry object.
* *
...@@ -164,10 +157,8 @@ class Registry implements DestructableInterface { ...@@ -164,10 +157,8 @@ class Registry implements DestructableInterface {
* The theme initialization. * The theme initialization.
* @param string $theme_name * @param string $theme_name
* (optional) The name of the theme for which to construct the registry. * (optional) The name of the theme for which to construct the registry.
* @param \Drupal\Core\Cache\CacheBackendInterface $runtime_cache
* The cache backend interface to use for the runtime theme registry data.
*/ */
public function __construct($root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, $theme_name = NULL, CacheBackendInterface $runtime_cache = NULL) { public function __construct($root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, $theme_name = NULL) {
$this->root = $root; $this->root = $root;
$this->cache = $cache; $this->cache = $cache;
$this->lock = $lock; $this->lock = $lock;
...@@ -175,7 +166,6 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte ...@@ -175,7 +166,6 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte
$this->themeName = $theme_name; $this->themeName = $theme_name;
$this->themeHandler = $theme_handler; $this->themeHandler = $theme_handler;
$this->themeInitialization = $theme_initialization; $this->themeInitialization = $theme_initialization;
$this->runtimeCache = $runtime_cache;
} }
/** /**
...@@ -249,7 +239,7 @@ public function get() { ...@@ -249,7 +239,7 @@ public function get() {
public function getRuntime() { public function getRuntime() {
$this->init($this->themeName); $this->init($this->themeName);
if (!isset($this->runtimeRegistry[$this->theme->getName()])) { if (!isset($this->runtimeRegistry[$this->theme->getName()])) {
$this->runtimeRegistry[$this->theme->getName()] = new ThemeRegistry('theme_registry:runtime:' . $this->theme->getName(), $this->runtimeCache ?: $this->cache, $this->lock, array('theme_registry'), $this->moduleHandler->isLoaded()); $this->runtimeRegistry[$this->theme->getName()] = new ThemeRegistry('theme_registry:runtime:' . $this->theme->getName(), $this->cache, $this->lock, array('theme_registry'), $this->moduleHandler->isLoaded());
} }
return $this->runtimeRegistry[$this->theme->getName()]; return $this->runtimeRegistry[$this->theme->getName()];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment