File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,27 @@ public function process(ContainerBuilder $container)
3232 }
3333
3434 $ storage = $ container ->getParameter ('fos_user.storage ' );
35+
3536 if ('custom ' === $ storage ) {
3637 return ;
3738 }
3839
40+ $ validationFile = __DIR__ . '/../../Resources/config/validation/ ' . $ storage . '.xml ' ;
41+
42+ if ($ container ->hasDefinition ('validator.builder ' )) {
43+ // Symfony 2.5+
44+ $ container ->getDefinition ('validator.builder ' )
45+ ->addMethodCall ('addXmlMapping ' , array ($ validationFile ));
46+
47+ return ;
48+ }
49+
50+ // Old method of loading validation
3951 if (!$ container ->hasParameter ('validator.mapping.loader.xml_files_loader.mapping_files ' )) {
4052 return ;
4153 }
4254
4355 $ files = $ container ->getParameter ('validator.mapping.loader.xml_files_loader.mapping_files ' );
44- $ validationFile = __DIR__ . '/../../Resources/config/validation/ ' . $ storage . '.xml ' ;
4556
4657 if (is_file ($ validationFile )) {
4758 $ files [] = realpath ($ validationFile );
You can’t perform that action at this time.
0 commit comments