diff options
Diffstat (limited to 'src/index.php')
-rw-r--r-- | src/index.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/index.php b/src/index.php index b7e0397..5350680 100644 --- a/src/index.php +++ b/src/index.php @@ -17,6 +17,7 @@ use Twig\TwigFilter; use Twig\TwigFunction; header_remove("X-Powered-By"); +$GLOBALS["startTime"] = microtime(true); include __DIR__ . "/application/appdef.php"; @@ -181,6 +182,8 @@ function render(string $page, array $context = [], array $functions = []): void $twig->addFunction(new TwigFunction("renderPostSummary", renderPostSummary(...), [ "is_safe" => ["html"] ])); $twig->addFunction(new TwigFunction("permission", fn(string $name): int => constant(UserPermissions::class . "::" . $name))); $twig->addFunction(new TwigFunction("getAndClearFormError", RequestUtils::getAndClearFormError(...))); + $twig->addFunction(new TwigFunction("getQueryCount", $GLOBALS["db"]->getQueryCount(...))); + $twig->addFunction(new TwigFunction("getRunTime", fn() => microtime(true) - $GLOBALS["startTime"])); $twig->addFunction(new TwigFunction("lastFormField", function(string $formId, string $field): ?string { $lastFormId = ""; $lastForm = RequestUtils::getLastForm($lastFormId) ?? null; |