Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
294
Merge Requests
294
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
4a95e650
Commit
4a95e650
authored
Jul 19, 2016
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2761403
by Berdir: Move runtime theme registry into bootstrap cache
parent
53704b73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
core/core.services.yml
core/core.services.yml
+1
-1
core/lib/Drupal/Core/Theme/Registry.php
core/lib/Drupal/Core/Theme/Registry.php
+12
-2
No files found.
core/core.services.yml
View file @
4a95e650
...
...
@@ -1408,7 +1408,7 @@ services:
arguments
:
[
'
@app.root'
,
'
@theme_handler'
,
'
@cache.bootstrap'
,
'
@module_handler'
]
theme.registry
:
class
:
Drupal\Core\Theme\Registry
arguments
:
[
'
@app.root'
,
'
@cache.default'
,
'
@lock'
,
'
@module_handler'
,
'
@theme_handler'
,
'
@theme.initialization'
]
arguments
:
[
'
@app.root'
,
'
@cache.default'
,
'
@lock'
,
'
@module_handler'
,
'
@theme_handler'
,
'
@theme.initialization'
,
null
,
'
@cache.bootstrap'
]
tags
:
-
{
name
:
needs_destruction
}
calls
:
...
...
core/lib/Drupal/Core/Theme/Registry.php
View file @
4a95e650
...
...
@@ -140,6 +140,13 @@ class Registry implements DestructableInterface {
*/
protected
$themeManager
;
/**
* The runtime cache.
*
* @var \Drupal\Core\Cache\CacheBackendInterface
*/
protected
$runtimeCache
;
/**
* Constructs a \Drupal\Core\Theme\Registry object.
*
...
...
@@ -157,8 +164,10 @@ class Registry implements DestructableInterface {
* The theme initialization.
* @param string $theme_name
* (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
)
{
public
function
__construct
(
$root
,
CacheBackendInterface
$cache
,
LockBackendInterface
$lock
,
ModuleHandlerInterface
$module_handler
,
ThemeHandlerInterface
$theme_handler
,
ThemeInitializationInterface
$theme_initialization
,
$theme_name
=
NULL
,
CacheBackendInterface
$runtime_cache
=
NULL
)
{
$this
->
root
=
$root
;
$this
->
cache
=
$cache
;
$this
->
lock
=
$lock
;
...
...
@@ -166,6 +175,7 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte
$this
->
themeName
=
$theme_name
;
$this
->
themeHandler
=
$theme_handler
;
$this
->
themeInitialization
=
$theme_initialization
;
$this
->
runtimeCache
=
$runtime_cache
;
}
/**
...
...
@@ -239,7 +249,7 @@ public function get() {
public
function
getRuntime
()
{
$this
->
init
(
$this
->
themeName
);
if
(
!
isset
(
$this
->
runtimeRegistry
[
$this
->
theme
->
getName
()]))
{
$this
->
runtimeRegistry
[
$this
->
theme
->
getName
()]
=
new
ThemeRegistry
(
'theme_registry:runtime:'
.
$this
->
theme
->
getName
(),
$this
->
cache
,
$this
->
lock
,
array
(
'theme_registry'
),
$this
->
moduleHandler
->
isLoaded
());
$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
());
}
return
$this
->
runtimeRegistry
[
$this
->
theme
->
getName
()];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment