Skip to content

Commit 3d80497

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: (33 commits) do not pass a boolean to the constructor of the Dotenv class [Notifier] Fix low-deps tests Deprecate Composer 1 [Filesystem] Add third argument `$lockFile` to `Filesystem::appendToFile()` [TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflow extensions [PhpUnitBridge] fix symlink to bridge in docker by making its path relative [Dotenv] Duplicate $_SERVER values in $_ENV if they don't exist Fix markup [Notifier] Add Expo bridge Add polish translations (#43725) Rename translation:update to translation:extract [String] Add PLURAL_MAP "zombies" -- fix #43789 Added support for `statusCode` default parameter when loading a template directly from route using the `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` controller. [Validator] Update validators.bs.xlf Cache voters that will always abstain [Messenger] Fix `TraceableMessageBus` implementation so it can compute caller even when used within a callback [Validator] Add the missing translations for Russian (ru) [Validator] Added missing translations for Latvian (lv) [Validator] Added missing translations [Validator] Add missing translations for Vietnamese (VI) ...
2 parents dc9932f + ab1bdf9 commit 3d80497

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\DependencyInjection;
1313

14+
use Composer\InstalledVersions;
1415
use Symfony\Bridge\Twig\Extension\LogoutUrlExtension;
1516
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
1617
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FirewallListenerFactoryInterface;
@@ -71,6 +72,10 @@ public function prepend(ContainerBuilder $container)
7172

7273
public function load(array $configs, ContainerBuilder $container)
7374
{
75+
if (!class_exists(InstalledVersions::class)) {
76+
trigger_deprecation('symfony/security-bundle', '5.4', 'Configuring Symfony without the Composer Runtime API is deprecated. Consider upgrading to Composer 2.');
77+
}
78+
7479
if (!array_filter($configs)) {
7580
return;
7681
}
@@ -92,7 +97,7 @@ public function load(array $configs, ContainerBuilder $container)
9297

9398
$loader->load('security_authenticator.php');
9499

95-
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'])) {
100+
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'], true)) {
96101
$loader->load('templating_twig.php');
97102
}
98103

@@ -102,7 +107,7 @@ public function load(array $configs, ContainerBuilder $container)
102107
$loader->load('security_debug.php');
103108
}
104109

105-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
110+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'], true)) {
106111
$container->removeDefinition('security.expression_language');
107112
$container->removeDefinition('security.access.expression_voter');
108113
}
@@ -797,7 +802,7 @@ private function createExpression(ContainerBuilder $container, string $expressio
797802
return $this->expressions[$id];
798803
}
799804

800-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
805+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'], true)) {
801806
throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
802807
}
803808

0 commit comments

Comments
 (0)