GitInfo::hash($long)), new Twig_Function('git_tag', fn() => GitInfo::tag()), new Twig_Function('git_branch', fn() => GitInfo::branch()), new Twig_Function('startup_time', fn(float $time = MSZ_STARTUP) => microtime(true) - $time), new Twig_Function('sql_query_count', fn() => DB::queries()), ]; } public static function assetUrl(string $path): string { $realPath = realpath(MSZ_ROOT . '/public/' . $path); if($realPath === false || !file_exists($realPath)) { return $path; } return $path . '?' . filemtime($realPath); } }