feat: implement initial read only access

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-07 21:58:35 -04:00
parent 661e0e1213
commit 92e85aed47
17 changed files with 863 additions and 4 deletions
+6 -1
View File
@@ -9,6 +9,11 @@ use RuntimeException;
class DiscoveryClient
{
public function fetch(ServerAddress $server): DiscoveryDocument
{
return DiscoveryDocument::parse($this->fetchXml($server), $server);
}
public function fetchXml(ServerAddress $server): string
{
$curl = curl_init($server->discoveryUrl());
$xml = '';
@@ -36,7 +41,7 @@ class DiscoveryClient
throw new RuntimeException('Discovery returned HTTP ' . $status
. ($status === 404 ? '. Enable WOPI and forward /hosting/discovery through the proxy.' : '. Expected HTTP 200; redirects are not followed.'));
}
return DiscoveryDocument::parse($xml, $server);
return $xml;
} finally {
curl_close($curl);
}