-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
PHP ConfigBuilders of DEV-only bundles not working in PROD environment #48891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not sure I completely understand what you are trying to achieve. Why are you trying to configure a bundle that is not enabled? |
Cause it's enabled in DEV environment ;-) |
Well, you can store the file in |
@MatTheCat Is this the right syntax for multiple environments?: return #[When(env: 'dev')] #[When(env: 'test')] static function (WebProfilerConfig $webProfilerConfig,...) @xabbuh |
This is indeed a problem. If we want people to use generated config builders single config files for all environments, we need a solution for bundles that are missing in prod. |
@derrabus I believe #41182 is the solution, but it’s not (AFAICT) documented. @ThomasLandauer I just tested and it seems you’re right about the multiple env syntax. |
symfony/symfony-docs#15333 was the corresponding docs issue, but it was closed although the PR linked there did not document that attributes can be attached to closures. Can you open a new issue (or PR if you want) on the docs repo? |
Well, the According to symfony/symfony-docs#16313 (comment) this was done on purpose, and is about to be reorganized. So I'm not doing anything in the docs. |
That comment is > 1 year old. Don't if that should stop you from contributing to the docs. cc @wouterj |
The trick with I'm +1 on using Are you ok to make those changes, @ThomasLandauer? |
FYI #41182 also injected an |
As a start, I went through https://symfony.com/doc/current/configuration.html and created some minor PR's:
For now, I stopped at this sentence:
Question: The
But since when is it created by default? I.e. since which version is My suggestion for the following paragraph would be: Show the Minor question: Can I delete |
Symfony version(s) affected
6.2.4
Description
Since some bundles are not loaded in PROD (e.g.
DebugBundle
orWebProfilerBundle
), the dependency injection for their PHP config files is not working (since their*Config
class is not generated).How to reproduce
config/packages/debug.php
:config/bundles.php
:Then running
APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear
results in this error:Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: