Yaffs site version 1.1
[yaffs-website] / vendor / drush / drush / commands / core / outputformat / json.inc
1 <?php
2
3 /**
4  * Output formatter 'json'
5  *
6  * @param $data
7  *   The $data parameter is converted to Javascript Object Notation
8  * @param $metadata
9  *   Unused
10  *
11  * Code:
12  *
13  *   return array(
14  *     "a" => array("b" => 2, "c" => 3),
15  *     "d" => array("e" => 5, "f" => 6)
16  *   );
17  *
18  * Output with --format=json:
19  *
20  *   {"a":{"b":2,"c":3},"d":{"e":5,"f":6}}
21  */
22 class drush_outputformat_json extends drush_outputformat {
23   function format($input, $metadata) {
24     return drush_json_encode($input);
25   }
26 }