You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #43788 [DependencyInjection][FrameworkBundle][SecurityBundle][TwigBundle] Require Composer's runtime API to be present (derrabus)
This PR was merged into the 6.0 branch.
Discussion
----------
[DependencyInjection][FrameworkBundle][SecurityBundle][TwigBundle] Require Composer's runtime API to be present
| Q | A
| ------------- | ---
| Branch? | 6.0
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Recently, I was asked to help debugging a strange behavior of my client's app that surfaced only on some developer machines while others were fine. Turns out, a particular package was installed as a dev dependency (which was fine because we used it for dev tooling only at that time) and the difference between the environments was that the broken ones used Composer 2.
With `ContainerBuilder::willBeAvailable()`, we have introduced logic into the very heart of the framework that exposes significantly different behavior for Composer 1 and 2.
With this PR, I'd like to propose to make Composer's runtime API a requirement, essentially making the use of Composer 2 a requirement. Composer 2 has been released over a year ago and by now every developer should have been able to upgrade to version 2. I don't think that this constraint would push the ecosystem too hard.
Let's make everyone's lives easier by moving on to Composer 2.
Commits
-------
e08b36258b Require Composer's runtime API to be present
trigger_deprecation('symfony/security-bundle', '5.4', 'Configuring Symfony without the Composer Runtime API is deprecated. Consider upgrading to Composer 2.1 or later.');
81
-
}
82
-
83
78
if (!array_filter($configs)) {
84
79
return;
85
80
}
@@ -101,7 +96,7 @@ public function load(array $configs, ContainerBuilder $container)
101
96
102
97
$loader->load('security_authenticator.php');
103
98
104
-
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'], true)) {
99
+
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'])) {
105
100
$loader->load('templating_twig.php');
106
101
}
107
102
@@ -111,7 +106,7 @@ public function load(array $configs, ContainerBuilder $container)
111
106
$loader->load('security_debug.php');
112
107
}
113
108
114
-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'], true)) {
109
+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
@@ -831,7 +826,7 @@ private function createExpression(ContainerBuilder $container, string $expressio
831
826
return$this->expressions[$id];
832
827
}
833
828
834
-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'], true)) {
829
+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
835
830
thrownew \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
0 commit comments