Restructure
New Journal entries
Colour tabs update with wind
This commit is contained in:
fraxle
2026-08-31 15:12:45 +01:00
parent 47818fba33
commit 71860b9dd9
40 changed files with 3430 additions and 443 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
// ─── SunScope — JSON response helpers ────────────────────────────────────
function json_out(array $data, int $status = 200): void {
http_response_code($status);
header('Content-Type: application/json');
echo json_encode($data);
exit;
}
function json_error(string $message, int $status = 400): void {
json_out(['ok' => false, 'error' => $message], $status);
}
function json_body(): array {
$body = json_decode(file_get_contents('php://input'), true);
return is_array($body) ? $body : [];
}
function require_method(string $method): void {
if ($_SERVER['REQUEST_METHOD'] !== $method) {
json_error('Method not allowed', 405);
}
}