-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
I'd like to see the core config command handle updates as well. For example, for updating WP_DEBUG, I'd run something like this:
wp core config WP_DEBUG true
(similarly to git config user.name Name).
A couple of quick notes:
- I understand that
wp-config.phpcan contain arbitrary PHP and implementing the proposed functionality can be a bit tricky. My approach would be to strictly specify how thecore configcommand works, for example, only supporting simple constants and putting them right beforerequire_once(ABSPATH . 'wp-settings.php');or something like that. If the file structure doesn't conform to whatcore configexpects, it would do nothing and only print an error message. - Was thinking whether there should be a separate (sub)command for this but I think that the
core configcould be used for this seamlessly. - Data types would need some attention. For example, the example given above (updating
WP_DEBUG) would need to correctly put a boolean intowp-config.phpwhile in other cases, strings or numbers could be required. I think that most cases could be handled automatically but there could also be switches like--boolor--int, similarly to whatgit configsupports.
What do you think? I'd be willing to contribute the code but wanted to discuss it first.
Reactions are currently unavailable