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 6fdd6d3

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 ee91a6a commit 6fdd6d3
Copy full SHA for 6fdd6d3

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
@@ -1033,29 +1033,28 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10331033
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
10341034
$rootDir = $container->getParameter('kernel.root_dir');
10351035
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
1036-
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations')) {
1036+
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations', false)) {
10371037
$dirs[] = $dir;
10381038
} else {
10391039
$nonExistingDirs[] = $dir;
10401040
}
1041-
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
1041+
if ($container->fileExists($dir = $rootDir.sprintf('/Resources/%s/translations', $name), false)) {
10421042
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.', $dir, $defaultDir), E_USER_DEPRECATED);
1043-
10441043
$dirs[] = $dir;
10451044
} else {
10461045
$nonExistingDirs[] = $dir;
10471046
}
10481047
}
10491048

10501049
foreach ($config['paths'] as $dir) {
1051-
if ($container->fileExists($dir)) {
1050+
if ($container->fileExists($dir, false)) {
10521051
$dirs[] = $dir;
10531052
} else {
10541053
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
10551054
}
10561055
}
10571056

1058-
if ($container->fileExists($defaultDir)) {
1057+
if ($container->fileExists($defaultDir, false)) {
10591058
$dirs[] = $defaultDir;
10601059
} else {
10611060
$nonExistingDirs[] = $defaultDir;

0 commit comments

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