q('SELECT * FROM settings WHERE id = 1;'); self::$s = $s ? $s->fetch() : []; // load the player's auth self::$auth->good(); } // load flash messages self::$flashes = $_SESSION['flash'] ?? []; } public static function performDatabaseReset(): void { if (file_exists(self::$dbPath)) { unlink(self::$dbPath); self::$db = new Database(self::$dbPath); } } public static function auth(): bool { return self::$auth->good(); } public static function flash(string $key, mixed $value = null): mixed { // get a flash message if ($value === null) return self::$flashes[$key] ?? null; // set a flash message $_SESSION['flash'][$key] = $value; self::$flashes[$key] = $value; } public function __destruct() { // clean up flash messages unset($_SESSION['flash']); } }