Create wp config get to list configurations of wp-config.php#9
Create wp config get to list configurations of wp-config.php#9danielbachhuber merged 4 commits intowp-cli:masterfrom rahul3883:issue/GH-2
wp config get to list configurations of wp-config.php#9Conversation
danielbachhuber
left a comment
There was a problem hiding this comment.
Great start! 👍
One comment to address, and you'll need to add a functional test too.
src/Config_Command.php
Outdated
| $formatter->display_items( $wp_config_vars ); | ||
|
|
||
| WP_CLI::line( preg_replace( '/^([A-Z ]+)/m', WP_CLI::colorize( '%9\1%n' ), "\nCONSTANTS\n" ) ); | ||
| $formatter->display_items( $wp_config_constants ); |
There was a problem hiding this comment.
Let's consolidate this to just one table, and introduce a third type column that denotes whether it's a variable or constant
If it's just one call to display_items(), the --format=json, etc. will produce machine-parsable output. If you call display_items() more than once, the rendered JSON isn't easily digestible.
There was a problem hiding this comment.
Let's consolidate this to just one table, and introduce a third type column that denotes whether it's a variable or constant
Sounds good. Done.
If it's just one call to display_items(), the --format=json, etc. will produce machine-parsable output. If you call display_items() more than once, the rendered JSON isn't easily digestible.
👍
I believe a functional test should be the last part. So I was waiting for your reply about any changes if needed 😅 |
|
Looks great! Thanks for your work :) |
Create `wp config get` to list configurations of `wp-config.php`
We can also format the result using
--formatoption.eg.
wp config get --format=csvFixes #2