getPath()), '/'); $filePath = $this->documentRoot . $requestPath; $documentPath = $filePath; if (! is_file($documentPath)) { $documentPath = $filePath . '/' . $this->indexFile; } if (is_file($documentPath) && str_ends_with($documentPath, '.php')) { ob_start(); try { include $documentPath; } catch (\Throwable $exception) { echo <<setBody($content); $response->setStatusCode(Status::SUCCESS); $response->setMeta('text/gemini; charset=utf-8'); } else { return parent::__invoke($response, $request); } return $response; } }