Skip to content

Commit 17fb364

Browse files
committed
Updated the HtmlDiffService Configuration to grab the Kernal cache location
1 parent 814a0c1 commit 17fb364

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

DependencyInjection/Configuration.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
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;
89

910
/**
1011
* This is the class that validates and merges configuration from your app/config files
@@ -13,6 +14,13 @@
1314
*/
1415
class Configuration implements ConfigurationInterface
1516
{
17+
protected $kernel;
18+
19+
public function __construct(KernelInterface $kernel)
20+
{
21+
$this->kernel = $kernel;
22+
}
23+
1624
/**
1725
* {@inheritDoc}
1826
*/
@@ -37,6 +45,9 @@ public function getConfigTreeBuilder()
3745
->booleanNode('use_table_diffing')
3846
->defaultTrue()
3947
->end()
48+
->scalerNode('purifier_cache_location')
49+
->defaultValue($this->kernel->getCacheDir())
50+
->end()
4051
->integerNode('match_threshold')->end()
4152
->append($this->getDoctrineCacheDriverNode('doctrine_cache_driver'))
4253
->end();

Resources/config/services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
services:
77
caxy.html_diff.config:
88
class: %caxy.html_diff.config.class%
9+
arguments: [@kernel]
910
factory: [%caxy.html_diff.config.class%, create]
1011
caxy.html_diff:
1112
class: %caxy.html_diff.class%

0 commit comments

Comments
 (0)