dwpage: output meta data as JSON
json shows the same nested data but is easier to process by other tools
This commit is contained in:
parent
3fe0184449
commit
8d670f35f5
|
@ -139,7 +139,6 @@ class PageCLI extends CLI {
|
|||
false,
|
||||
'getmeta'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,10 +184,9 @@ class PageCLI extends CLI {
|
|||
case 'getmeta':
|
||||
$wiki_id = array_shift($args);
|
||||
$key = trim(array_shift($args));
|
||||
$meta=print_r(p_get_metadata($wiki_id, $key), true);
|
||||
print($meta);
|
||||
if (strcmp(substr($meta, -1), "\n"))
|
||||
print("\n");
|
||||
$meta = p_get_metadata($wiki_id, $key, METADATA_RENDER_UNLIMITED);
|
||||
echo trim(json_encode($meta, JSON_PRETTY_PRINT));
|
||||
echo "\n";
|
||||
break;
|
||||
default:
|
||||
echo $options->help();
|
||||
|
|
Loading…
Reference in New Issue