Skip to content

Commit 96fb009

Browse files
committed
Merge pull request #1 from dbergunder/Update-Service-Configuration-For-HTMLPurifier-Settings
Update service configuration for html purifier settings
2 parents 814a0c1 + c77429c commit 96fb009

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

DependencyInjection/CaxyHtmlDiffExtension.php

Lines changed: 5 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
}
@@ -75,6 +78,7 @@ protected function loadHtmlDiffConfig(array $config, ContainerBuilder $container
7578
'insert_space_in_replace' => 'setInsertSpaceInReplace',
7679
'match_threshold' => 'setMatchThreshold',
7780
'use_table_diffing' => 'setUseTableDiffing',
81+
'purifier_cache_location' => 'setPurifierCacheLocation',
7882
);
7983

8084
foreach ($methodsToCall as $key => $methodName) {

DependencyInjection/Configuration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function getConfigTreeBuilder()
3737
->booleanNode('use_table_diffing')
3838
->defaultTrue()
3939
->end()
40+
->scalarNode('purifier_cache_location')
41+
->defaultNull()
42+
->end()
4043
->integerNode('match_threshold')->end()
4144
->append($this->getDoctrineCacheDriverNode('doctrine_cache_driver'))
4245
->end();

0 commit comments

Comments
 (0)