Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Update/UpdateServiceProvider.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Core\Update; | |
4 | |
5 use Drupal\Core\DependencyInjection\ContainerBuilder; | |
6 use Drupal\Core\DependencyInjection\ServiceModifierInterface; | |
7 use Drupal\Core\DependencyInjection\ServiceProviderInterface; | |
8 use Symfony\Component\DependencyInjection\Definition; | |
9 use Symfony\Component\DependencyInjection\Reference; | |
10 | |
11 /** | |
12 * Ensures for some services that they don't cache. | |
13 */ | |
14 class UpdateServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { | |
15 | |
16 /** | |
17 * {@inheritdoc} | |
18 */ | |
19 public function register(ContainerBuilder $container) { | |
20 $definition = new Definition('Drupal\Core\Cache\NullBackend', ['null']); | |
21 $container->setDefinition('cache.null', $definition); | |
22 } | |
23 | |
24 /** | |
25 * {@inheritdoc} | |
26 */ | |
27 public function alter(ContainerBuilder $container) { | |
28 $definition = $container->getDefinition('asset.resolver'); | |
29 $argument = new Reference('cache.null'); | |
30 $definition->replaceArgument(5, $argument); | |
31 | |
32 $definition = $container->getDefinition('library.discovery.collector'); | |
33 $argument = new Reference('cache.null'); | |
34 $definition->replaceArgument(0, $argument); | |
35 } | |
36 | |
37 } |