maxime
maxime

Reputation: 2315

How to debug all parameters on environments in Symfony?

I would like to debug my Symfony parameters on specific environments by getting a table with all of them, and their values like:

Parameter  | prod  | dev  | foo   |
-----------|-------|------|-------|
appname    | toto  | titi | tata  |
isonline   | true  | true | true  |  // Inheritance appears
firstname  | undef | Bob  | Bob   |  // No values appears

Do you know if there is a feature/bundle/command to do that ?

It becomes necessary when you get more than 5 environments with different configurations.

Upvotes: 37

Views: 40132

Answers (3)

Tac Tacelosky
Tac Tacelosky

Reputation: 3426

Although the OP asks about parameters and not environment variables, I'll add this answer because someone who is searching may find this command, new in Symfony 5.4/6, helpful:

bin/console debug:dotenv

Upvotes: 9

numediaweb
numediaweb

Reputation: 17010

Regardless of how you set environment variables, you can see a full list with their values by running:

php bin/console debug:container --env-vars

See Symfony docs for more details.

Upvotes: 20

D. Schreier
D. Schreier

Reputation: 1788

As @Matteo said in comment, you could use the command below to see all your parameters

php bin/console debug:container --parameters --env=prod

But there is not any command to list all your parameters from all your environments, you have to make a script (bash script with grep and the command above) or a Symfony command to get exactly what you want.

Upvotes: 51

Related Questions