Skip to content

[Dotenv] add json output to DebugCommand.php #45822

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

Closed
wants to merge 4 commits into from

Conversation

jonashrem
Copy link
Contributor

adds an optional json output to 'debug:dotenv' command

Q A
Branch? 6.1
Bug fix? no
New feature? no
Deprecations? no
License MIT
Doc PR /

adds an optional json output to 'debug:dotenv' command
@ro0NL
Copy link
Contributor

ro0NL commented Mar 25, 2022

curious, why do you need a JSON machine format .. compared to current PHP machine format (.env.local.php)

perhaps the dotenv:dump command should be tweaked instead

@jonashrem
Copy link
Contributor Author

curious, why do you need a JSON machine format .. compared to current PHP machine format (.env.local.php)

perhaps the dotenv:dump command should be tweaked instead

To read information from external projects without changing them.

For my understanding, dotenv:dump writes files to a .env.local.php inside the project directory which is not always desired.

In my case, I want to get information from a project configuration without changing the project as I'm not in charge for the project.

A machine-readable output in DebugCommand allows me to get information from any symfony project without needing to check if there is an .env file or .env.local.php (or something else) from outside.

@jonashrem jonashrem closed this Apr 3, 2022
@jonashrem jonashrem reopened this Apr 3, 2022
@jonashrem jonashrem closed this Apr 3, 2022
@jonashrem jonashrem reopened this Apr 3, 2022
@GromNaN GromNaN added the Dotenv label Apr 4, 2022
@carsonbot carsonbot changed the title add json output to DebugCommand.php [Dotenv] add json output to DebugCommand.php Apr 4, 2022
@GromNaN
Copy link
Member

GromNaN commented Apr 4, 2022

Other debug:* commands use the DescriptorInterface. Adding a new output format is a great opportunity to refactor and use this feature.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Leveraging the descriptors as suggested seems like a good idea to me.

jonashrem and others added 2 commits April 5, 2022 01:58
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Alexander M. Turek <me@derrabus.de>
@derrabus
Copy link
Member

derrabus commented Apr 6, 2022

By the way, we need tests for this feature.

@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
@fabpot
Copy link
Member

fabpot commented Jul 20, 2022

Closing for now as it should leverage the already existing infrastructure, which would make a very different PR.

@fabpot fabpot closed this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants