Added method to json fetch build info (useful for build_nr -> git hash mapping

This commit is contained in:
Latif Khalifa
2013-10-16 09:00:51 +00:00
parent d8a62bbca2
commit 2b20d28a92

21
builds_map.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
define("SITE_ROOT", realpath(dirname(__file__)));
require_once SITE_ROOT . "/lib/init.php";
$builds = array();
$res = $DB->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);