4 * Output formatter 'print-r'
7 * The $data parameter is rendered with the php print_r function
9 * 'label' - If present, prints "label: " prior to the data
14 * "a" => array("b" => 2, "c" => 3),
15 * "d" => array("e" => 5, "f" => 6)
18 * Output with --format=print-r:
35 class drush_outputformat_print_r extends drush_outputformat {
36 function format($input, $metadata) {
37 if (is_string($input)) {
38 $output = '"' . $input . '"';
40 elseif (is_array($input) || is_object($input)) {
41 $output = print_r($input, TRUE);
46 if (isset($metadata['label'])) {
47 $output = $metadata['label'] . ': ' . $output;