-
Notifications
You must be signed in to change notification settings - Fork 41
/
list_builds.php
53 lines (43 loc) · 1.59 KB
/
list_builds.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include("include/functions.php");
include("reports/reportsfunctions.php");
$branch = $_GET['branch'] ?? '';
isValidBranch($branch) or $branch = 'PHP_5_6';
$TITLE = "PHP: QA: PFTT: $branch";
$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__));
common_header(NULL);
echo '<h1><a href="pftt.php">', htmlentities($branch), "</a></h1>\n";
echo "<p>Choose a PHP revision or build</p>\n";
(function() use ($branch) {
$branchdir = makeBranchPath($branch);
if (!is_dir($branchdir)) { return; }
$revisions = scandir($branchdir);
if ($revisions === false) { return; }
$revisions = array_filter($revisions, function($rev) use ($branchdir) {
return ($rev !== '.') && ($rev !== '..') && is_dir("$branchdir/$rev");
});
if (empty($revisions)) { return; }
// Create an array of [ $rev => $mtime] pairs,
// sorted by mtime from most recent to least.
$revisions = array_flip($revisions);
foreach ($revisions as $revision => &$mtime) {
$mtime = filemtime("$branchdir/$revision");
}
unset($mtime);
arsort($revisions, SORT_NUMERIC);
// Output revisions, from most recent to least.
echo "<table class=\"pftt\">\n";
foreach ($revisions as $revision => $mtime) {
$revpath = makeRevisionPath($branch, $revision);
if (!is_dir($revpath)) { continue; }
$style = 'background: ' .
(is_file("$revpath/FAIL_CRASH.txt") ? '#ff0000' : '#ccff66');
echo "<tr style=\"$style\">";
echo '<td><a href="build.php?branch=', urlencode($branch),
'&revision=', urlencode($revision), '">',
htmlentities($revision), "</a></td></tr>\n";
}
echo "</table>\n";
echo "<br/><br/>\n";
})();
common_footer();