Skip to content

Commit e5fc4e4

Browse files
author
maxime.steinhausser
committed
[FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading
1 parent 87d2fec commit e5fc4e4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,16 +553,14 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
553553
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
554554
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
555555

556-
// with Symfony 2.4, the Security component was split into several subpackages
557-
// and the translations have been moved to the symfony/security-core package
558-
$translationsDir = dirname($r->getFilename()).'/../Resources/translations';
559-
560-
if (!file_exists($translationsDir) && file_exists($dir = dirname($r->getFilename()).'/../../Resources/translations')) {
556+
if (file_exists(dirname($r->getFilename()).'/../composer.json')) {
557+
// with Symfony 2.4, the Security component was split into several subpackages
558+
// and the translations have been moved to the symfony/security-core package
559+
$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
560+
} else {
561561
// in Symfony 2.3, translations are located in the symfony/security package
562-
$translationsDir = $dir;
562+
$dirs[] = dirname($r->getFilename()).'/../../Resources/translations';
563563
}
564-
565-
$dirs[] = $translationsDir;
566564
}
567565
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
568566
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {

0 commit comments

Comments
 (0)