chore: release v0.11.2

This commit is contained in:
2026-06-17 23:15:12 +02:00
parent 8b1609f5ce
commit b2a8b1946f
8 changed files with 81 additions and 25 deletions
+11 -4
View File
@@ -22,22 +22,29 @@ $DB_USER = 'opslog';
$DB_PASS = 'CHANGE_ME';
$STALE_SECONDS = 120; // an operator is "active" if seen within this window
// PHP 8.1+ makes mysqli THROW on errors by default; turn that off so a missing
// `live_status` table (not yet created by OpsLog) just yields an empty list
// instead of a fatal "table doesn't exist".
mysqli_report(MYSQLI_REPORT_OFF);
$mysqli = @new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if ($mysqli->connect_errno) {
http_response_code(500);
exit('DB error');
}
// The table is created by OpsLog on first publish; tolerate it not existing yet.
$rows = [];
$sql = "SELECT operator, station, freq_hz, band, mode, updated_at
FROM live_status
WHERE updated_at >= UTC_TIMESTAMP() - INTERVAL ? SECOND
ORDER BY band, freq_hz";
if ($stmt = $mysqli->prepare($sql)) {
if ($stmt = @$mysqli->prepare($sql)) {
$stmt->bind_param('i', $STALE_SECONDS);
$stmt->execute();
$res = $stmt->get_result();
while ($r = $res->fetch_assoc()) $rows[] = $r;
@$stmt->execute();
if ($res = $stmt->get_result()) {
while ($r = $res->fetch_assoc()) $rows[] = $r;
}
}
$station = $rows ? $rows[0]['station'] : 'OpsLog';