From 2b20d28a9279e642e4325d4bbb3cc88aaa093fc2 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Wed, 16 Oct 2013 09:00:51 +0000 Subject: [PATCH] Added method to json fetch build info (useful for build_nr -> git hash mapping --- builds_map.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 builds_map.php diff --git a/builds_map.php b/builds_map.php new file mode 100644 index 0000000..7dd78d0 --- /dev/null +++ b/builds_map.php @@ -0,0 +1,21 @@ +query("select chan, nr as build_nr, version, hash, modified from builds order by nr desc, chan asc"); +while ($row = $DB->fetchRow($res)) { + $build = new stdClass; + + foreach($row as $key=>$val) { + if (false === filter_var($key, FILTER_VALIDATE_INT)) { + $build->$key = $val; + } + } + + $builds[] = $build; + } + +header("Content-Type: application/json"); +print json_encode($builds);