CLI_Command::param_dump PHP Method

param_dump() public method

## OPTIONS [--with-values] : Display current values also. [--format=] : Render output in a particular format. --- default: json options: - var_export - json --- ## EXAMPLES # Dump the list of global parameters. $ wp cli param-dump --format=var_export array ( 'path' => array ( 'runtime' => '=', 'file' => '', 'synopsis' => '', 'default' => NULL, 'multiple' => false, 'desc' => 'Path to the WordPress files.', ), 'url' => array (
public param_dump ( $_, $assoc_args )
    function param_dump($_, $assoc_args)
    {
        $spec = \WP_CLI::get_configurator()->get_spec();
        if (\WP_CLI\Utils\get_flag_value($assoc_args, 'with-values')) {
            $config = \WP_CLI::get_configurator()->to_array();
            // Copy current config values to $spec
            foreach ($spec as $key => $value) {
                if (isset($config[0][$key])) {
                    $current = $config[0][$key];
                } else {
                    $current = NULL;
                }
                $spec[$key]['current'] = $current;
            }
        }
        if ('var_export' === \WP_CLI\Utils\get_flag_value($assoc_args, 'format')) {
            var_export($spec);
        } else {
            echo json_encode($spec);
        }
    }