[VarDumper] Add VAR_DUMPER_FORMAT=server format#35967
Merged
fabpot merged 1 commit intosymfony:masterfrom Aug 13, 2020
ogizanagi:var-dumper/server-format-env-var
Merged
[VarDumper] Add VAR_DUMPER_FORMAT=server format#35967fabpot merged 1 commit intosymfony:masterfrom ogizanagi:var-dumper/server-format-env-var
fabpot merged 1 commit intosymfony:masterfrom
ogizanagi:var-dumper/server-format-env-var
Conversation
lyrixx
reviewed
Mar 5, 2020
Contributor
Author
|
@nicolas-grekas : I've updated the PR, so it should work now using |
ogizanagi
commented
Apr 17, 2020
|
|
||
| * added `RdKafka` support | ||
| * added `VAR_DUMPER_FORMAT=server` support | ||
| * prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set |
Contributor
Author
There was a problem hiding this comment.
Btw what about considering this behavior as a bug fix? Getting something else than the expected format when using VAR_DUMPER_FORMAT looks unexpected to me.
Contributor
Author
There was a problem hiding this comment.
What do you think about this? Bug fix or not bug fix?
fabpot
approved these changes
Aug 13, 2020
Member
|
Thank you @ogizanagi. |
fabpot
added a commit
that referenced
this pull request
Aug 16, 2020
…RMAT (ogizanagi) This PR was merged into the 4.4 branch. Discussion ---------- [VarDumper] Backport handler lock when using VAR_DUMPER_FORMAT | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | N/A <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | N/A Backport of the "lock" behavior from #35967, preventing unexpected handler change when using the `VAR_DUMPER_FORMAT` env var. --- As a concrete example of this not working as expected: Start a PHPUnit test suite with this env var to the desired format. If a web test case is making a request (with debug enabled), the `DebugBundle` replaces the handler set initially by the `VAR_DUMPER_FORMAT`, will collect dumps into the profiler, but won't output these. As well, for dumps made in between the the kernel is boot (`DebugBundle::build()` is called) and a request, the dumps are properly sent to the output with expected format, but looses colors. IMHO, the use-cases of `VAR_DUMPER_FORMAT` justifies locking the handler for the whole process. Commits ------- 19b341e [VarDumper] Backport handler lock when using VAR_DUMPER_FORMAT
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows discussion in #35801 and adds support for a
servervalue for the existingVAR_DUMPER_FORMATenv var.It comes as well with two more things:
the handler is registered as soon as thewe prevent registering another handler as soon as theVAR_DUMPER_FORMATenv var is detectedVAR_DUMPER_FORMATenv var is set, instead of checking if there was a previous handler (which could make this env var useless in some conditions where the handler was already set by another "process")This PR means anyone can use dump with a server in any context, without changing a single line of code in the project by:
./vendor/bin/var-dump-server --format=html > dumps.htmlVAR_DUMPER_FORMAT=server [your-cli-command]Previous related PRs: