load(); session_start(); $auth0_session = Auth::client()->getCredentials(); if (!is_null($auth0_session)) { $_SESSION['user_id'] = $auth0_session->user['sub']; } Configuration::$pdoDSN = 'sqlite:' . implode(DIRECTORY_SEPARATOR, [__DIR__, 'data', 'mpj.db']); Configuration::$mode = Mode::SQLite; Definition::ensureTable(Table::REQUEST); /** * Is this an htmx request? * * @return bool True if this is an htmx request, false if not */ function is_htmx(): bool { return key_exists('HTTP_HX_REQUEST', $_SERVER) && !key_exists('HTTP_HX_HISTORY_RESTORE_REQUEST', $_SERVER); } function page_link(string $href, string $text, array $attrs = []): void { echo ' $value) echo " $key=\"" . htmlspecialchars($value) . "\""; echo ">$text"; } /** * Generate a material icon * * @param string $name The name of the material icon * @return string The material icon wrapped in a `span` tag */ function icon(string $name): string { return " "; } function page_head(string $title): void { Layout::htmlHead($title); echo '
'; if (!is_htmx()) echo '