Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitbccbe64

Browse files
committed
Use is_dir instead of file_exists to check if translation directories exist
This makes sure there actual directories by that name, not just fileswith the name we'd expect to be a directory
1 parentc4b40e3 commitbccbe64

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,12 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10941094
$defaultDir =$container->getParameterBag()->resolveValue($config['default_path']);
10951095
$rootDir =$container->getParameter('kernel.root_dir');
10961096
foreach ($container->getParameter('kernel.bundles_metadata')as$name =>$bundle) {
1097-
if (\file_exists($dir =$bundle['path'].'/Resources/translations')) {
1097+
if (\is_dir($dir =$bundle['path'].'/Resources/translations')) {
10981098
$dirs[] =$dir;
10991099
}else {
11001100
$nonExistingDirs[] =$dir;
11011101
}
1102-
if (\file_exists($dir =$rootDir.sprintf('/Resources/%s/translations',$name))) {
1102+
if (\is_dir($dir =$rootDir.sprintf('/Resources/%s/translations',$name))) {
11031103
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.',$dir,$defaultDir),E_USER_DEPRECATED);
11041104
$dirs[] =$dir;
11051105
}else {
@@ -1108,7 +1108,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11081108
}
11091109

11101110
foreach ($config['paths']as$dir) {
1111-
if (\file_exists($dir)) {
1111+
if (\is_dir($dir)) {
11121112
$dirs[] =$transPaths[] =$dir;
11131113
}else {
11141114
thrownew \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory',$dir));
@@ -1123,13 +1123,13 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11231123
$container->getDefinition('console.command.translation_update')->replaceArgument(6,$transPaths);
11241124
}
11251125

1126-
if (\file_exists($defaultDir)) {
1126+
if (\is_dir($defaultDir)) {
11271127
$dirs[] =$defaultDir;
11281128
}else {
11291129
$nonExistingDirs[] =$defaultDir;
11301130
}
11311131

1132-
if (\file_exists($dir =$rootDir.'/Resources/translations')) {
1132+
if (\is_dir($dir =$rootDir.'/Resources/translations')) {
11331133
if ($dir !==$defaultDir) {
11341134
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.',$dir,$defaultDir),E_USER_DEPRECATED);
11351135
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp