Skip to content

[Console][FrameworkBundle] Add DotenvDebugCommand #42580

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

Merged
merged 1 commit into from
Oct 16, 2021
Merged

[Console][FrameworkBundle] Add DotenvDebugCommand #42580

merged 1 commit into from
Oct 16, 2021

Conversation

chr-hertel
Copy link
Contributor

@chr-hertel chr-hertel commented Aug 15, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #41958
License MIT
Doc PR symfony/symfony-docs#15734

Bildschirmfoto von 2021-08-15 13-57-48

  • Command Implementation
  • Tests
  • Docs

Copy link
Contributor

@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

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

(yes i want this 😁 )

Copy link
Contributor

@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

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

(travis failure is a pesky newline ;))

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.

Note that the Dotenv component might not be installed in a Symfony application. This new command should probably…

  • not be wired by FrameworkExtension
  • output a nice error message

… if the component is unavailable.

@chr-hertel
Copy link
Contributor Author

chr-hertel commented Aug 20, 2021

@derrabus would it be sufficient to extend the isEnabled() to not only check for $_SERVER['SYMFONY_DOTENV_VARS'] but also add class_exists(DotEnv::class)?

edit: needed some additional changes to AddConsoleCommandPass to make isEnabled really count ... not really sure about that

@derrabus derrabus changed the title [Dotenv] Adding DotenvDebugCommand [Dotenv] Add DotenvDebugCommand Aug 22, 2021
@derrabus
Copy link
Member

We should add a line to FrameworkBundle's ChangeLog:

 * Add DotenvDebugCommand

And since your changes to FrameworkBundle rely on the is_enabled attribute you've added to the Console component, FrameworkBundle should conflict with

"symfony/console": "<5.4",

@carsonbot carsonbot changed the title [Dotenv] Add DotenvDebugCommand [Console][FrameworkBundle] Add DotenvDebugCommand Aug 22, 2021
@fabpot
Copy link
Member

fabpot commented Aug 22, 2021

What about moving this command to the Dotenv component (that's what we are doing for component related commands)?

@chr-hertel chr-hertel changed the title [Console][FrameworkBundle] Add DotenvDebugCommand [DotEnv][FrameworkBundle] Add DotenvDebugCommand Aug 22, 2021
@chr-hertel chr-hertel changed the title [DotEnv][FrameworkBundle] Add DotenvDebugCommand [Dotenv][FrameworkBundle] Add DotenvDebugCommand Aug 22, 2021
@chr-hertel chr-hertel requested a review from derrabus August 29, 2021 15:15
@carsonbot carsonbot changed the title [Dotenv][FrameworkBundle] Add DotenvDebugCommand [Console][FrameworkBundle] Add DotenvDebugCommand Aug 29, 2021
@derrabus
Copy link
Member

@symfony/mergers Is there anything left to do here? From my POV, this PR is ready to be merged.

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

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

Nice addition!

@fabpot
Copy link
Member

fabpot commented Oct 16, 2021

Thank you @chr-hertel.

@fabpot fabpot merged commit f1b8b6e into symfony:5.4 Oct 16, 2021
@chr-hertel chr-hertel deleted the dotenv-debug-command branch October 18, 2021 16:30
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 26, 2021
…d (chr-hertel)

This PR was merged into the 5.4 branch.

Discussion
----------

[Dotenv] extending env var list with debug:dotenv command

Was not sure about where to put this ...

symfony/symfony#42580

Commits
-------

77d5506 extending env var list with debug:dotenv command
This was referenced Nov 5, 2021
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.

[DotEnv] Additional debug command to get more info about the vars and files
9 participants