Skip to content

Refactor config command to always validate in config transformer library #94

@schlessera

Description

@schlessera

Right now we have two separate code paths that deal with setting values in the wp-config.php file. While we created a new library wp-cli/wp-config-transformer to deal with config file manipulations, we still have old commands like wp config create that use their own logic to set the config values.

This means that for any validation logic we want to provide, we'd need to include it into both code paths.

To improve this situation, I'd like to refactor the old wp config create command to just render the mustache template with default values, and then pass all provided arguments through wp-cli/wp-config-transformer to set the config entries to the requested values. This way, we can concentrate all actual validation logic in wp-cli/wp-config-transformer, and the commands are all just shallow wrappings around that library.

cc @fjarrett

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