array( "title" => "server", "label" => "Server", "mysql" => "`url`" ), "country" => array( "title" => "country", "label" => "Country", "mysql" => "`l_ms`.`country_code`" ), "isos" => array( "title" => "wether isos are available", "label" => "ISOs", "mysql" => "`l_ms`.`isos`" ), "protocols" => array( "title" => "available protocols", "label" => "Protocols", "mysql" => "`protocols`" ) ); $query = "SELECT " . "GROUP_CONCAT(DISTINCT `l_ms`.`protocol`) AS `protocols`," . "SUBSTRING(`l_ms`.`url`,LENGTH(`l_ms`.`protocol`)+4) AS `url`," . "`l_ms`.`country`," . "`l_ms`.`country_code`," . "`l_ms`.`isos`," . "`l_ms`.`ipv4`," . "`l_ms`.`ipv6`" . " FROM (" . "SELECT " . "`mirror_statuses`.`url`," . "MAX(`mirror_statuses`.`start`) AS `start`" . " FROM `mirror_statuses`" . " WHERE `mirror_statuses`.`start` > UNIX_TIMESTAMP(NOW())-" . $cutoff . " GROUP BY `mirror_statuses`.`url`" . ") AS `ls`" . " JOIN `mirror_statuses` AS `l_ms`" . " ON `ls`.`url`=`l_ms`.`url`" . " AND `ls`.`start`=`l_ms`.`start`" . " GROUP BY `url`" . " ORDER BY "; if (array_key_exists("sort", $_GET)) { if (isset($sorts[$_GET["sort"]]["mysql"])) $query .= $sorts[$_GET["sort"]]["mysql"] . ","; elseif (isset($sorts[substr($_GET["sort"],1)]["mysql"])) $query .= $sorts[substr($_GET["sort"],1)]["mysql"] . " DESC,"; } $query .= "`url`"; $result = mysql_run_query( $query ); $last_check = 0; $max_count = 0; while($row = $result->fetch_assoc()) $rows[] = $row; print_header("Mirror Overview"); ?>
\n"; print " ".$sort["label"]."\n"; print " | \n"; } ?>\n"; print " " . $row["url"] . "\n"; print " | \n"; print "\n"; print " \n"; print " \n"; print " " . $row["country"] . "\n"; print " | \n"; print "\n"; if ($row["isos"]) print " Yes\n"; else print " No\n"; print " | \n"; print "\n"; print " " . $row["protocols"] . "\n"; print " | \n"; print " \n"; if ($oddity == "odd") $oddity = "even"; else $oddity = "odd"; } } else { print "There is no data, as no mirror checks run in the last " . $cutoff . " seconds."; } ?>
---|
The last mirror check ran at ${content['last_check']} UTC. Checks have ran ${content['num_checks']} times in the last $cutoff seconds at an average interval of ${content['check_frequency']} seconds.
This data is also available in JSON or TSV format. The units of all time/duration values are in seconds; date/time values are UTC.
EOF; } print json_encode($content, JSON_PRETTY_PRINT); print <<EOF; exit( ); } // human readable if (!export_as_requested( array( "json" => $content, "tsv" => $urls ), $uri_parts[1] )) { throw_http_error( 406, 'Not Acceptable', implode( "
\n", array_merge( array( 'Unknown output format.', 'Accepted:' ), array_map( function($type){ return '' . $type . ''; }, array('json', 'tsv') ) ) ) ); } die(); } // status throw_http_error(501, "Not Implemented");