From 8a6897e3fd2efceacf8d020dfbf8b742a68f96cd Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Fri, 19 Jul 2024 17:20:26 +0200 Subject: Add development server and refactor building --- common.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 common.php (limited to 'common.php') diff --git a/common.php b/common.php new file mode 100644 index 0000000..c505660 --- /dev/null +++ b/common.php @@ -0,0 +1,29 @@ +(.*?);i', + function(array $matches) use(&$title): string { + $title = $matches[1]; + return ""; + }, + $__page + ); + $page = SRCDIR . "/pages/" . bin2hex(random_bytes(8)) . ".tmp"; + file_put_contents($page, $__page); + unset($__page); + + ob_start(); + include SRCDIR . "/template.php"; + $output = ob_get_clean(); + if ($output === false) + $output = ""; + + if (is_file($page)) + unlink($page); + + return $output; +} -- cgit v1.2.3