Skip to content
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

Merged
merged 4 commits into from May 4, 2017
Merged

Create wp config get to list configurations of wp-config.php #9

merged 4 commits into from May 4, 2017

Conversation

rahul3883
Copy link
Contributor

@rahul3883 rahul3883 commented May 3, 2017

We can also format the result using --format option.
eg. wp config get --format=csv

Fixes #2

Copy link
Member

@danielbachhuber danielbachhuber left a 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.

$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 );
Copy link
Member

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.

Copy link
Contributor Author

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.

👍

@rahul3883
Copy link
Contributor Author

you'll need to add a functional test too.

I believe a functional test should be the last part. So I was waiting for your reply about any changes if needed 😅

@danielbachhuber
Copy link
Member

Looks great! Thanks for your work :)

@danielbachhuber danielbachhuber merged commit cf7da88 into wp-cli:master May 4, 2017
@rahul3883 rahul3883 deleted the issue/GH-2 branch May 4, 2017 19:30
schlessera pushed a commit that referenced this pull request Jan 6, 2022
Create `wp config get` to list configurations of `wp-config.php`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants