Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mix
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
mix
Commits
1690e6da
Commit
1690e6da
authored
2 years ago
by
lugir
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3341520
by pierostz: Mix with Admin Toolbar not playing nicely
parent
349adac2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MixServiceProvider.php
+6
-14
6 additions, 14 deletions
src/MixServiceProvider.php
with
6 additions
and
14 deletions
src/MixServiceProvider.php
+
6
−
14
View file @
1690e6da
...
...
@@ -33,7 +33,12 @@ class MixServiceProvider extends ServiceProviderBase {
public
function
register
(
ContainerBuilder
$container
)
{
// Only override services when dev_mode is enabled.
if
(
$this
->
isDevMode
)
{
$container
->
register
(
'cache.render'
,
'Drupal\mix\Cache\NullBackendFactory'
);
$cacheBins
=
[
'cache.render'
,
'cache.page'
,
'cache.dynamic_page_cache'
];
foreach
(
$cacheBins
as
$id
)
{
$container
->
register
(
$id
,
'Drupal\Core\Cache\NullBackend'
)
->
addArgument
(
substr
(
$id
,
strpos
(
$id
,
'.'
)
+
1
))
->
addTag
(
'cache.bin'
,
[
'default_backend'
=>
'mix.cache.backend.null'
]);
}
}
}
...
...
@@ -44,27 +49,14 @@ class MixServiceProvider extends ServiceProviderBase {
// Only alter services when dev_mode is enabled.
if
(
$this
->
isDevMode
)
{
// Enable cacheability headers debug.
$container
->
setParameter
(
'http.response.debug_cacheability_headers'
,
TRUE
);
// Enable twig debug.
$twig_config
=
$container
->
getParameter
(
'twig.config'
);
$twig_config
[
'debug'
]
=
TRUE
;
$twig_config
[
'auto_reload'
]
=
TRUE
;
$twig_config
[
'cache'
]
=
FALSE
;
$container
->
setParameter
(
'twig.config'
,
$twig_config
);
// Disable cache bins by changed cache backend to NullBackendFactory.
$ids
=
[
'cache.render'
,
'cache.page'
,
'cache.dynamic_page_cache'
];
foreach
(
$ids
as
$id
)
{
if
(
$container
->
hasDefinition
(
$id
))
{
$definition
=
$container
->
getDefinition
(
$id
);
$definition
->
setClass
(
'Drupal\mix\Cache\NullBackendFactory'
);
$definition
->
addTag
(
'cache.bin'
,
[
'default_backend'
=>
'mix.cache.backend.null'
]);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment