8000 bug #11283 [SecurityBundle] Remove Expression Language services when … · symfony/symfony@ce29e0a · GitHub
[go: up one dir, main page]

Skip to content

Commit ce29e0a

Browse files
committed
bug #11283 [SecurityBundle] Remove Expression Language services when the component is unavailable (thewilkybarkid)
This PR was merged into the 2.4 branch. Discussion ---------- [SecurityBundle] Remove Expression Language services when the component is unavailable | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The Expression Language isn't a dependency of the SecurityBundle, but ExpressionVoter is still added if it isn't installed, leading to a class not found fatal error. This removes the services (alternatively the services could be moved to a different file and added if it is installed). Commits ------- 557a82a Remove Expression Language services when the component is unavailable
2 parents 5b2e34f + 557a82a commit ce29e0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public function load(array $configs, ContainerBuilder $container)
6666
$loader->load('templating_twig.xml');
6767
$loader->load('collectors.xml');
6868

69+
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
70+
$container->removeDefinition('security.expression_language');
71+
$container->removeDefinition('security.access.expression_voter');
72+
}
73+
6974
// set some global scalars
7075
$container->setParameter('security.access.denied_url', $config['access_denied_url']);
7176
$container->setParameter('security.authentication.manager.erase_credentials', $config['erase_credentials']);

0 commit comments

Comments
 (0)
0