wp-cli / config-command

Generates and reads the wp-config.php file.
MIT License
38 stars 36 forks source link

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

Open schlessera opened 5 years ago

schlessera commented 5 years ago

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

swissspidy commented 1 month ago

Reopening because #181 was reverted for the time being