672b78a1ee344af346ad7491b8fae22e17f39ff0
[WebKit-https.git] / Websites / test-results / api / manifest.php
1 <?php
2
3 require_once('../include/json-shared.php');
4
5 $db = connect();
6 $tests = $db->fetch_table('tests');
7
8 function fetch_table_and_create_map_by_id($table_name) {
9     global $db;
10
11     $rows = $db->fetch_table($table_name);
12     if (!$rows)
13         return array();
14
15     $results = array();
16     foreach ($rows as $row) {
17         $results[$row['id']] = $row;
18     }
19     return $results;
20 }
21
22 exit_with_success(array('tests' => $tests,
23     'builders' => fetch_table_and_create_map_by_id('builders'),
24     'slaves' => fetch_table_and_create_map_by_id('slaves'),
25     'repositories' => fetch_table_and_create_map_by_id('repositories')));
26
27 ?>