Skip to content

[DI][FrameworkBundle] Allow overriding existing env vars with EnvVarLoaderInterface #17700

Closed
@faizanakram99

Description

@faizanakram99

Description

EnvVarLoaderInterface is a nice way of providing env vars dynamically, it is particularly useful for multi-tenant apps where env vars like DATABASE_URL can be loaded from an external vault.

This comment symfony/symfony#34295 (comment) has a nice example of its usage.

The latest best practices of Symfony recommend to add default env vars to .env file, it doesn't work well with multi-tenant setup where DATABASE_URL can be different for each tenant as the EnvVarLoader won't override existing env vars which were loaded from .env file, hence the "feature request", can we add possibility of overriding existing env vars in EnvVarLoaders ?

Example

No response

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