com web/qa: Sort list of builds by time: list_builds.php
| From: | Matt Ficken | Date: | Mon, 12 May 2014 00:27:09 +0000 |
| Subject: | com web/qa: Sort list of builds by time: list_builds.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-67313@lists.php.net to get a copy of this message | ||
Commit: e4b923d529f4b6572fb9de97845947ae148a2ba1
Author: v-mafick@microsoft.com <v-mafick@microsoft.com> Sun, 11 May 2014 17:27:09
-0700
Parents: e061706827f481eac713bd0614267748adbfa4af
Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=e4b923d529f4b6572fb9de97845947ae148a2ba1
Log:
Sort list of builds by time
Changed paths:
M list_builds.php
Diff:
diff --git a/list_builds.php b/list_builds.php
index 1b058c4..060826c 100755
--- a/list_builds.php
+++ b/list_builds.php
@@ -31,6 +31,8 @@ sort($r);
$latest_revision = '';
$mtime = 0;
+$revisions_by_mtime = array();
+
foreach ( $r as $revision ) {
if ($revision=="." or $revision=="..")
continue;
@@ -41,9 +43,20 @@ foreach ( $r as $revision ) {
$latest_revision = $revision;
$latest_revision_mtime = $mtime;
}
+ $revisions_by_mtime[$mtime] = $revision;
}
} // end foreach
+$mtimes = array_keys($revisions_by_mtime);
+
+sort($mtimes);
+
+$revisions = array();
+
+foreach ($mtimes as $mtime) {
+ array_push($revisions, $revisions_by_mtime[$mtime]);
+}
+
$red = is_file(BASE_REPORT_DIR."/$branch/$latest_revision/FAIL_CRASH.txt");
@@ -58,11 +71,8 @@ $red =
is_file(BASE_REPORT_DIR."/$branch/$latest_revision/FAIL_CRASH.txt");
<table class="pftt">
<?php
-foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) {
- if ($revision=="." or $revision=="..")
- continue;
- if (is_dir(BASE_REPORT_DIR."/$branch/$revision")) {
- $red = is_file(BASE_REPORT_DIR."/$branch/$revision/FAIL_CRASH.txt");
+foreach ( $revisions as $revision ) {
+ $red = is_file(BASE_REPORT_DIR."/$branch/$revision/FAIL_CRASH.txt");
?>
<tr style="background:<?php echo $red ? '#ff0000' : '#ccff66';
?>">
@@ -70,7 +80,6 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) {
</tr>
<?php
- } // end if
} // end foreach