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 5a4d9dc

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 128a16b commit 5a4d9dc
Copy full SHA for 5a4d9dc

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,27 +1006,27 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10061006
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
10071007
$rootDir = $container->getParameter('kernel.root_dir');
10081008
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
1009-
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations')) {
1009+
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations', false)) {
10101010
$dirs[] = $dir;
10111011
} else {
10121012
$nonExistingDirs[] = $dir;
10131013
}
1014-
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
1014+
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name), false)) {
10151015
$dirs[] = $dir;
10161016
} else {
10171017
$nonExistingDirs[] = $dir;
10181018
}
10191019
}
10201020

10211021
foreach ($config['paths'] as $dir) {
1022-
if ($container->fileExists($dir)) {
1022+
if ($container->fileExists($dir, false)) {
10231023
$dirs[] = $dir;
10241024
} else {
10251025
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
10261026
}
10271027
}
10281028

1029-
if ($container->fileExists($defaultDir)) {
1029+
if ($container->fileExists($defaultDir, false)) {
10301030
$dirs[] = $defaultDir;
10311031
} else {
10321032
$nonExistingDirs[] = $defaultDir;

0 commit comments

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