8000 feature #20547 [FrameworkBundle] Allowed symlinks when searching for … · symfony/symfony@6f6100a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f6100a

Browse files
committed
feature #20547 [FrameworkBundle] Allowed symlinks when searching for translation, searialization and validation files (tifabien)
This PR was squashed before being merged into the 3.3-dev branch (closes #20547). Discussion ---------- [FrameworkBundle] Allowed symlinks when searching for translation, searialization and validation files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - When we have a symlink folder in app/Resources/translations, files inside this symlink are not handled. Commits ------- 4874e43 [FrameworkBundle] Allowed symlinks when searching for translation, searialization and validation files
2 parents dda3760 + 4874e43 commit 6f6100a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
893893

894894
$files = array();
895895
$finder = Finder::create()
896+
->followLinks()
896897
->files()
897898
->filter(function (\SplFileInfo $file) {
898899
return 2 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename());
@@ -1004,10 +1005,10 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
10041005
}
10051006

10061007
if (is_dir($dir = $dirname.'/Resources/config/validation')) {
1007-
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
1008+
foreach (Finder::create()->followLinks()->files()->in($dir)->name('*.xml') as $file) {
10081009
$files[0][] = $file->getPathname();
10091010
}
1010-
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
1011+
foreach (Finder::create()->followLinks()->files()->in($dir)->name('*.yml') as $file) {
10111012
$files[1][] = $file->getPathname();
10121013
}
10131014

@@ -1187,13 +1188,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
11871188
}
11881189

11891190
if (is_dir($dir = $dirname.'/Resources/config/serialization')) {
1190-
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
1191+
foreach (Finder::create()->followLinks()->files()->in($dir)->name('*.xml') as $file) {
11911192
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getPathname()));
11921193
$definition->setPublic(false);
11931194

11941195
$serializerLoaders[] = $definition;
11951196
}
1196-
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
1197+
foreach (Finder::create()->followLinks()->files()->in($dir)->name('*.yml') as $file) {
11971198
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname()));
11981199
$definition->setPublic(false);
11991200

0 commit comments

Comments
 (0)
0