gives the bytes.
function how_files(array $e): array {
return array_values(array_unique([$e["file"], ...$e["files"]]));
}
function how(int $n): void {
$e = exhibits()[$n] ?? null;
if (!$e) { http_response_code(404); echo "no such exhibit\n"; return; }
$files = how_files($e);
if (isset($_GET["raw"])) {
// Only the files this exhibit names: never anything else in the checkout.
if (!in_array($_GET["raw"], $files, true)) { http_response_code(404); echo "not one of this exhibit's files\n"; return; }
header("Content-Type: text/plain; charset=utf-8");
header("Cache-Control: no-store");
readfile(ZOO_ROOT . "/" . $_GET["raw"]);
return;
}
$deploy = fact("deploy.json")[env("RC_ENV")] ?? [];
header("Content-Type: text/html; charset=utf-8");
header("Cache-Control: no-store");
?>
How: = h($e["title"]) ?>
= rc_head(false) ?>
">
= rc_header("Zoo", auth_user(), "/api/3/signout", false) ?>
← back to the zoo
= $n ?>. = h($e["title"]) ?>
= h($e["promise"]) ?>
= h($e["block"]) ?>
This is the code serving the zoo right now: read from disk for this request, from commit
= h(substr($deploy["commit"] ?? "unknown", 0, 10)) ?> (= h(env("RC_ENV")) ?>). The zoo's own self-check fetches this
page and compares it byte for byte with the file it runs.
= h($f) ?> sha256 = substr(hash("sha256", $src), 0, 12) ?> · raw
$line) echo '', $i + 1, " ", h($line), "\n"; ?>