Skip to content

Commit 10aae59

Browse files
committed
Removed injection of the kernal. Set the extension to add the purifier_cache_location on load.
1 parent 17fb364 commit 10aae59

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

DependencyInjection/CaxyHtmlDiffExtension.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ public function load(array $configs, ContainerBuilder $container)
4343

4444
$cacheDriverId = null;
4545

46-
4746
if (!empty($config['doctrine_cache_driver']) && $config['doctrine_cache_driver']['enabled']) {
4847
$cacheDriverId = $this->loadCacheDriver('doctrine_cache_driver', $config['doctrine_cache_driver'], $container);
4948
}
5049

50+
if (!isset($config['purifier_cache_location']) {
51+
$config['purifier_cache_location'] = $container->getParameter('kernel.cache_dir');
52+
}
53+
5154
foreach ($config as $key => $value) {
5255
$container->setParameter($this->getAlias() . '.' . $key, $value);
5356
}

DependencyInjection/Configuration.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
66
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
77
use Symfony\Component\Config\Definition\ConfigurationInterface;
8-
use Symfony\Component\HttpKernel\KernelInterface;
98

109
/**
1110
* This is the class that validates and merges configuration from your app/config files
@@ -14,13 +13,6 @@
1413
*/
1514
class Configuration implements ConfigurationInterface
1615
{
17-
protected $kernel;
18-
19-
public function __construct(KernelInterface $kernel)
20-
{
21-
$this->kernel = $kernel;
22-
}
23-
2416
/**
2517
* {@inheritDoc}
2618
*/
@@ -46,7 +38,7 @@ public function getConfigTreeBuilder()
4638
->defaultTrue()
4739
->end()
4840
->scalerNode('purifier_cache_location')
49-
->defaultValue($this->kernel->getCacheDir())
41+
->defaultNull()
5042
->end()
5143
->integerNode('match_threshold')->end()
5244
->append($this->getDoctrineCacheDriverNode('doctrine_cache_driver'))

0 commit comments

Comments
 (0)