Skip to content
Snippets Groups Projects
Commit 3210ba77 authored by lugir's avatar lugir
Browse files

Issue #3340796 by pierostz, Lugir: Twig cache auto-reload not working

parent 137378ec
No related branches found
Tags 1.1.1-rc1
No related merge requests found
......@@ -4,8 +4,9 @@ services:
arguments: ['@current_user']
tags:
- { name: event_subscriber }
mix.config_overrider:
class: Drupal\mix\Config\ConfigOverride
tags:
- { name: config.factory.override, priority: 5 }
mix.cache.backend.null:
class: Drupal\mix\Cache\NullBackendFactory
<?php
namespace Drupal\mix\Cache;
use Drupal\Core\Cache\CacheFactoryInterface;
use Drupal\Core\Cache\NullBackend;
class NullBackendFactory implements CacheFactoryInterface {
/**
* {@inheritdoc}
*/
public function get($bin) {
return new NullBackend($bin);
}
/**
* Deletes all cache items in a bin.
*/
public function deleteAll() {}
}
......@@ -15,7 +15,7 @@ class MixServiceProvider extends ServiceProviderBase {
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
$container->register('cache.render', 'Drupal\mix\Cache\NullBackendFactory');
}
/**
......@@ -45,7 +45,8 @@ class MixServiceProvider extends ServiceProviderBase {
foreach ($ids as $id) {
if ($container->hasDefinition($id)) {
$definition = $container->getDefinition($id);
$definition->setClass('Drupal\Core\Cache\NullBackendFactory');
$definition->setClass('Drupal\mix\Cache\NullBackendFactory');
$definition->addTag('cache.bin', ['default_backend' => 'mix.cache.backend.null']);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment