From 39ef4946058641540ee89ed233121512d84fac40 Mon Sep 17 00:00:00 2001 From: Thayol Date: Sun, 9 Aug 2026 16:11:37 +0200 Subject: [PATCH] Collapse most files into index.php --- functions.php | 46 ------------------------- index.php | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++- options.php | 16 --------- script.php | 33 ------------------ 4 files changed, 93 insertions(+), 96 deletions(-) delete mode 100644 functions.php delete mode 100644 options.php delete mode 100644 script.php diff --git a/functions.php b/functions.php deleted file mode 100644 index a0207f8..0000000 --- a/functions.php +++ /dev/null @@ -1,46 +0,0 @@ - + [ + "name" => "Linux", + "architecture" => "x86-64", + "download_path" => "", + "download_filename" => "supercardinality", + ], + "windows" => [ + "name" => "Windows", + "architecture" => "x86-64", + "download_path" => "", + "download_filename" => "supercardinality.exe", + ], +]; + +$os_guess = guess_os(); + +$latest = json_decode(file_get_contents('releases/latest.json'), true); +$version = empty($latest["version"]) ? "" : $latest["version"]; +$version_timestamp = empty($latest["timestamp"]) ? -1 : $latest["timestamp"]; +$version_timestamp_in_words = timestamp_in_words($version_timestamp); + +if (!empty($latest["linux_path"])) { + $options["linux"]["download_path"] = $latest["linux_path"]; + if (!str_contains($latest["linux_path"], "://")) { + $options["linux"]["download_path"] = "releases/" . $options["linux"]["download_path"]; + } +} + +if (!empty($latest["windows_path"])) { + $options["windows"]["download_path"] = $latest["windows_path"]; + if (!str_contains($latest["windows_path"], "://")) { + $options["windows"]["download_path"] = "releases/" . $options["windows"]["download_path"]; + } +} + +$display_other_builds = false; +foreach($options as $os => $target) { + if (!empty($target["download_path"])) { + $display_other_builds = true; + } +} + +?> diff --git a/options.php b/options.php deleted file mode 100644 index a960c16..0000000 --- a/options.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - "name" => "Linux", - "architecture" => "x86-64", - "download_path" => "", - "download_filename" => "supercardinality", - ], - "windows" => [ - "name" => "Windows", - "architecture" => "x86-64", - "download_path" => "", - "download_filename" => "supercardinality.exe", - ], -]; diff --git a/script.php b/script.php deleted file mode 100644 index 801fdd8..0000000 --- a/script.php +++ /dev/null @@ -1,33 +0,0 @@ - $target) { - if (!empty($target["download_path"])) { - $display_other_builds = true; - } -}