New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create wp config get
to list configurations of wp-config.php
#9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
--format
option.eg.
wp config get --format=csv
Fixes #2