Skip to content

debug:dotenv command doesn't show environment variables #54640

Closed
@CViniciusSDias

Description

@CViniciusSDias

Symfony version(s) affected

7.0.6

Description

If you have an environment variable set, the debug:dotenv command doesn't display it. It doesn't even display the values set in the .env files.

How to reproduce

On any symfony application, define a value in .env file. Let's use TEST as example:

TEST=value

Run php bin/console debug:dotenv and see that it's correctly displayed.

Now run TEST=other php bin/console debug:dotenv and see that it's not there anymore.

Possible Solution

No response

Additional Context

The command only shows what's in 'SYMFONY_DOTENV_VARS'. Since the value is now an env var, on Dotenv.php:192 it will skip the iteration and it will never be defined in $loadedVars nor in $_SERVER['SYMFONY_DOTENV_VARS'].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions