Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebProfiler] add cURL copy/paste to request tab#62320

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
darkweak wants to merge2 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromdarkweak:feat/profiler/add-curl-copy-paste-request

Conversation

@darkweak
Copy link

@darkweakdarkweak commentedNov 5, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix #...
LicenseMIT

I often need to replay some requests on my application in dev mode, it's easier to generate it in the profiler Request view, copy it and paste in the terminal. It will generate the command with all given parameters/headers.

Here is a screenshot of this:
Capture d’écran 2025-11-05 à 20 31 44

I don't know if it's mandatory to write tests for that, feel free to give some advice about that.

GromNaN reacted with thumbs up emoji
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.4" but it seems your PR description refers to branch "7.4 for features".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the titlefeat(profiler): add cURL copy/paste to request tab feat(profiler): add cURL copy/paste to request tabNov 5, 2025
@darkweakdarkweak changed the title feat(profiler): add cURL copy/paste to request tab[WebProfiler] add cURL copy/paste to request tabNov 5, 2025
@darkweakdarkweakforce-pushed thefeat/profiler/add-curl-copy-paste-request branch 2 times, most recently from8409ee2 tocff32efCompareNovember 5, 2025 19:43
Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The curl command generation is flawed for several reasons:

  • it does not escape arguments properly (making it unsuitable to be used as is)
  • it usescurl -X even whenit should not be used

Such logic should also be implemented in PHP in a method of the collector instead of attempting to write such complex logic in the Twig template (anyway, escaping shell arguments properly is not something we can do in Twig with only core functions and filters).

Note also that this won't make it to 7.4 (or 8.0) as we are way past the feature freeze date (which was end of September). This will be for 8.1.

darkweak reacted with thumbs up emoji
@stof
Copy link
Member

stof commentedNov 5, 2025

You could see also HttpClientDataCollector which implements such "Copy as curl" as well.

@darkweak
Copy link
Author

Thank you for these feedback. I'm unsure about where to implement the collector, so where would you put the PHP class in the WebProfiler bundle codebase?

@stof
Copy link
Member

stof commentedNov 5, 2025

you don't need to implement a new collector. You need to add a new method in the RequestCollector (as you are adding that logic in the request panel, i.e. the panel associated to the RequestCollector)

darkweak reacted with thumbs up emoji

@darkweakdarkweakforce-pushed thefeat/profiler/add-curl-copy-paste-request branch fromcff32ef to0dbe5dbCompareNovember 5, 2025 21:33
@darkweak
Copy link
Author

Okay, I have updated the RequestDataCollector class and I have something working in the template that is cleaner. 👍

@darkweakdarkweakforce-pushed thefeat/profiler/add-curl-copy-paste-request branch 4 times, most recently froma49f4fd tof835973CompareNovember 5, 2025 21:59
@darkweakdarkweakforce-pushed thefeat/profiler/add-curl-copy-paste-request branch 2 times, most recently from206ffa1 tof04f599CompareNovember 6, 2025 07:10
@darkweakdarkweakforce-pushed thefeat/profiler/add-curl-copy-paste-request branch fromf04f599 toe4c4ff1CompareNovember 6, 2025 07:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

3 participants

@darkweak@carsonbot@stof

[8]ページ先頭

©2009-2025 Movatter.jp