As a WordPress developer, it would be helpful to have a wp config get command to list configuration defined in parsed wp-config.php
This command could contain both constants and PHP global variables defined in wp-config.php. We can take a similar approach to WP_CLI\Runner in identifying this data:
// Load wp-config.php code, in the global scope
$wp_cli_original_defined_vars = get_defined_vars();
eval( $this->get_wp_config_code() );
foreach( get_defined_vars() as $key => $var ) {
if ( array_key_exists( $key, $wp_cli_original_defined_vars ) || 'wp_cli_original_defined_vars' === $key ) {
continue;
}
global $$key;
$$key = $var;
}
Previously wp-cli/wp-cli#3831
As a WordPress developer, it would be helpful to have a
wp config getcommand to list configuration defined in parsed wp-config.phpThis command could contain both constants and PHP global variables defined in
wp-config.php. We can take a similar approach toWP_CLI\Runnerin identifying this data:Previously wp-cli/wp-cli#3831