Skip to content

Improve %env()% parameters in debug:config output #20684

@javiereguiluz

Description

@javiereguiluz

Problem

When using runtime env variables for config:

# app/config/config.yml
doctrine:
    dbal:
        url: "%env(DATABASE_URL)%"

# app/config/parameters.yml
parameters:
    env(DATABASE_URL): 'sqlite:///%kernel.root_dir%/data/blog.sqlite'

The output of debug:config looks like this:

$ ./bin/console debug:config doctrine

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                url: env_DATABASE_URL_b188317b1d181eca5f0be35aefdae9c4
                ...

Although the output is technically precise, it looks weird and even like an error.

Solution

Could we keep the original value of those parameters? (Maybe displaying their default values too)

$ ./bin/console debug:config doctrine

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                url: "%env(DATABASE_URL)%" # default: 'sqlite:///%kernel.root_dir%/data/blog.sqlite'
                ...

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