summaryrefslogtreecommitdiff
path: root/buildmaster/status.php
diff options
context:
space:
mode:
Diffstat (limited to 'buildmaster/status.php')
-rw-r--r--buildmaster/status.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/buildmaster/status.php b/buildmaster/status.php
index 32f386d..28eee69 100644
--- a/buildmaster/status.php
+++ b/buildmaster/status.php
@@ -1,3 +1,13 @@
+<?php
+
+ include "lib/mysql.php";
+
+ $result = mysql_run_query(
+ "SELECT MAX(`package_sources`.`commit_time`) AS `last`" .
+ "FROM `package_sources`"
+ );
+
+?>
<html>
<head>
<title>Build master status</title>
@@ -7,19 +17,7 @@
<a href="https://buildmaster.archlinux32.org/">Start page</a><br>
<?php
-$mysql = new mysqli("localhost", "webserver", "empty", "buildmaster");
-if ($mysql->connect_error) {
- die("Connection failed: " . $mysql->connect_error);
-}
-
-if ( ! $result = $mysql -> query(
- "SELECT MAX(`package_sources`.`commit_time`) AS `last`" .
- "FROM `package_sources`"
- ))
- die($mysql->error);
-
if ($result -> num_rows > 0) {
-
$row = $result->fetch_assoc();
print "latest package source is from " . $row["last"] . ".<br>\n";
}