load(); if (php_sapi_name() != 'cli') { 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_head(string $title): void { Layout::htmlHead($title); echo '
'; if (!is_htmx()) echo '