Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/buildmaster/status.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
committerErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
commit5c5ed42237757efcf698a36c37cf9bd0630232c3 (patch)
tree184a92122c95c33ccb09aa5db2955af2d32e2771 /buildmaster/status.php
parent8af016645fee5c0b22e69d46de9b3401c1bc82d3 (diff)
buildmaster/*.php: use lib/mysql.php
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";
}