Skip to content

Config Environment Variables #26

@levidurfee

Description

@levidurfee

Is your feature request related to a problem? Please describe.
Storing configuration settings in a file is a bit troublesome. Maintaing a file between different environments can be difficult.

Describe the solution you'd like
I would like for ExpressionEngine to store configuration settings in environment variables, or at least have that option. It could check if the environment variable is set, if it is set it would use it, but if it isn't set it would use a setting from the .env.php (or similar) file. At the time of writing this I don't see any potential drawbacks.

Describe alternatives you've considered
The config.php is in the .gitignore file, so I am free to edit it as I see fit and it won't be checked into any repo. I could set my environment variables, and have the config.php file use the getenv() function to retrieve the data.

Teachability, Documentation, Adoption, Migration Strategy
The user could then store their configuration settings in environment variables which would allow them to easily have different stages of development. It would require an update to the System Configuration Overrides, and potentially other places.

Documentation change

$config['allow_avatar_uploads'] = 'y';
// would become
putenv('allow_avatar_uploads=y'); // The environment variable may be all uppercase

Migration Strategy
Allow both config methods. Maybe deprecate the current way in the next major release. Of course one way would need to override the other way, and that would need to be decided.

  • I am capable and would like to work on an implementation of this feature if it is considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions