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 28da4d2

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 0656723 commit 28da4d2
Copy full SHA for 28da4d2

File tree

Expand file treeCollapse file tree

1 file changed

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

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
@@ -1022,29 +1022,28 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10221022
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
10231023
$rootDir = $container->getParameter('kernel.root_dir');
10241024
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
1025-
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations')) {
1025+
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations', false)) {
10261026
$dirs[] = $dir;
10271027
} else {
10281028
$nonExistingDirs[] = $dir;
10291029
}
1030-
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
1030+
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name), false)) {
10311031
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.', $dir, $defaultDir), E_USER_DEPRECATED);
1032-
10331032
$dirs[] = $dir;
10341033
} else {
10351034
$nonExistingDirs[] = $dir;
10361035
}
10371036
}
10381037

10391038
foreach ($config['paths'] as $dir) {
1040-
if ($container->fileExists($dir)) {
1039+
if ($container->fileExists($dir, false)) {
10411040
$dirs[] = $dir;
10421041
} else {
10431042
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
10441043
}
10451044
}
10461045

1047-
if ($container->fileExists($defaultDir)) {
1046+
if ($container->fileExists($defaultDir, false)) {
10481047
$dirs[] = $defaultDir;
10491048
} else {
10501049
$nonExistingDirs[] = $defaultDir;

0 commit comments

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