File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 88 $ logs = array ();
99}
1010
11+ // We don't care about hashes on the frontend, and this lets us sort.
12+ $ logs ->incidence = get_object_vars ($ logs ->incidence );
13+
1114function format_log ($ log ) {
1215 $ log ->decoded_message = $ log ->message ;
1316 if ( $ log ->format == 'json ' ) {
@@ -23,6 +26,21 @@ function format_log($log) {
2326 $ log = format_log ($ log );
2427}
2528
29+ // Show log entries in reverse chronological order.
30+ $ logs ->log = array_reverse ($ logs ->log );
31+
32+ // Sort incidence entries by count.
33+ usort (
34+ $ logs ->incidence ,
35+ function ($ a , $ b ) {
36+ if ( $ a ->count == $ b ->count ) {
37+ return 0 ;
38+ }
39+ // We're sorting descending.
40+ return ( $ a ->count < $ b ->count ) ? 1 : -1 ;
41+ }
42+ );
43+
2644?>
2745<!doctype html>
2846<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
You can’t perform that action at this time.
0 commit comments