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 039ecd6

Browse filesBrowse files
committed
No longer keep DirectoryResources for translation dirs in container
Now that the translator keeps track of its own directories for caching the container no longer needs to it. This means that when a translation changes or is added the container no longer needs to be fully rebuilt, saving a considerable amount of time.
1 parent a10b08d commit 039ecd6
Copy full SHA for 039ecd6

File tree

1 file changed

+4
-5
lines changed
Filter options

1 file changed

+4
-5
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,22 +1091,21 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10911091
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
10921092
$rootDir = $container->getParameter('kernel.root_dir');
10931093
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
1094-
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations')) {
1094+
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations', false)) {
10951095
$dirs[] = $dir;
10961096
} else {
10971097
$nonExistingDirs[] = $dir;
10981098
}
1099-
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
1099+
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name), false)) {
11001100
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.', $dir, $defaultDir), E_USER_DEPRECATED);
1101-
11021101
$dirs[] = $dir;
11031102
} else {
11041103
$nonExistingDirs[] = $dir;
11051104
}
11061105
}
11071106

11081107
foreach ($config['paths'] as $dir) {
1109-
if ($container->fileExists($dir)) {
1108+
if ($container->fileExists($dir, false)) {
11101109
$dirs[] = $transPaths[] = $dir;
11111110
} else {
11121111
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
@@ -1121,7 +1120,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11211120
$container->getDefinition('console.command.translation_update')->replaceArgument(6, $transPaths);
11221121
}
11231122

1124-
if ($container->fileExists($defaultDir)) {
1123+
if ($container->fileExists($defaultDir, false)) {
11251124
$dirs[] = $defaultDir;
11261125
} else {
11271126
$nonExistingDirs[] = $defaultDir;

0 commit comments

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