-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Framework] Read env var SYMFONY_IDE by default for framework.ide #44575
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a small but great one, love it!
@GromNaN Can you have a look at the broken tests (the ones broken by this PR)? |
I was about to open a PR on symfony/recipes@4cabf21, but according to the readme I must wait for the next version to introduce a new way of doing thing. Which is useless since this will be the default behavior in Symfony 6.1. |
Yes, which is great news: You just avoided boilerplate code by adding great defaults :) For context: As e.g. the Fast track book and SymfonyCasts relies on Flex recipes, they must be kept reproducible. Even if this means that we can't backport new best/cool practices to older versions. |
Looks like there is an issue here, doctrinebundle tests are failing since this change https://github.com/doctrine/DoctrineBundle/runs/4571836311?check_suite_focus=true |
Thank you for reporting this issue. Here is a proposed fix : doctrine/DoctrineBundle#1448 The tests cases are registering the framework configuration without the compiler pass; which is not a use case for which we promise backward compatibility. |
…exception in case of fatal error (GromNaN) This PR was merged into the 6.1 branch. Discussion ---------- [ErrorHandler][HttpKernel] Read SYMFONY_IDE to render exception in case of fatal error | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - In #44575, the env var `SYMFONY_IDE` is read when `framework.ide` is not set. This works to format links in most runtime exceptions. But fatal errors that occurs before application boot are not rendered using this config (ex: syntax error in service class). Since the env var is globally available, it can be read even if it's not been injected. The list of IDE formats have been duplicated from [`FileLinkFormatter`](https://github.com/symfony/symfony/blob/8e8207bb72d7f2cb8be355994ad2fcfa97c00f74/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php#L27-L35). The update of `Symfony\Component\HttpKernel\Debug\FileLinkFormatter` is not necessary for my use-case, but for exhaustivity. Commits ------- 03ad4af Read SYMFONY_IDE to render exception in case of fatal error
This PR was merged into the 6.2 branch. Discussion ---------- update default value for framework.ide The default value was changed in symfony/symfony#44575 Commits ------- 9636026 update default value for framework.ide
This PR was merged into the 6.2 branch. Discussion ---------- update default value for framework.ide The default value was changed in symfony/symfony#44575 Commits ------- 9636026 update default value for framework.ide
Choosing an IDE is a personal preference, it should not be a project configuration (doc). In a team, each developer can use a different IDE, and a developer generally uses the same IDE on all their projects.
To setup a system-wide config, it is possible to update
xdebug.file_link_format
in php.ini. But that have to be done on every php version installed or any docker image; and we miss the shortcuts provided by Symfony.My proposition it to read an environment variable that can be set by the developers in their user profile or in
.env.local
. The nameSYMFONY_IDE
can be discussed.I currently uses the following config: