From c93880a266edaac4703a3f7be4047f404cff9c00 Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Fri, 26 Jul 2024 10:20:45 +0200 Subject: Add versions to assets --- common.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common.php') diff --git a/common.php b/common.php index cba823a..d1cd758 100644 --- a/common.php +++ b/common.php @@ -2,6 +2,13 @@ define("SRCDIR", realpath(__DIR__ . "/src/")); +function assetver(string $path): string { + $path = SRCDIR . "/" . $path; + if (!is_file($path)) + return "0"; + return md5_file($path); +} + function hzcom_expand(string $pageContents): string { $params = []; $page = SRCDIR . "/pages/" . bin2hex(random_bytes(8)) . ".tmp"; -- cgit v1.2.3