Skip to content

Commit

Permalink
compatibility with Security component split
Browse files Browse the repository at this point in the history
The FrameworkBundle in version 2.3 can be used with recent versions of
the Security component. However, after the Security component has been
split with Symfony 2.4, translations resources have been moved to the
`symfony/security-core` package. Thus, the changed location must be
taken into account.
  • Loading branch information
xabbuh committed Oct 5, 2015
1 parent 136722c commit 7bc836c
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -553,7 +553,16 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');

$dirs[] = dirname($r->getFilename()).'/../../Resources/translations';
$legacyTranslationsDir = dirname($r->getFilename()).'/../../Resources/translations';

if (file_exists($legacyTranslationsDir)) {
// in Symfony 2.3, translations are located in the symfony/security package
$dirs[] = $legacyTranslationsDir;
} else {
// with Symfony 2.4, the Security component was split into several subpackages
// and the translations have been moved to the symfony/security-core package
$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
}
}
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
Expand Down

0 comments on commit 7bc836c

Please sign in to comment.