Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4cdcf10

Browse filesBrowse files
committed
[FrameworkBundle] Allow custom services for validator mapping cache.
1 parent 98c8ec1 commit 4cdcf10
Copy full SHA for 4cdcf10

File tree

Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,12 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
442442
->info('validation configuration')
443443
->canBeEnabled()
444444
->children()
445-
->scalarNode('cache')->end()
445+
->scalarNode('cache')
446+
->beforeNormalization()
447+
// Can be removed in 3.0, once ApcCache support is dropped
448+
->ifString()->then(function ($v) { return 'apc' === $v ? 'validator.mapping.cache.apc' : $v; })
449+
->end()
450+
->end()
446451
->booleanNode('enable_annotations')->defaultFalse()->end()
447452
->arrayNode('static_method')
448453
->defaultValue(array('loadValidatorMetadata'))

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
716716
'validator_'.hash('sha256', $container->getParameter('kernel.root_dir'))
717717
);
718718

719-
$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference('validator.mapping.cache.'.$config['cache'])));
719+
$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache'])));
720720
}
721721

722722
switch ($config['api']) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.