generated from Nodarx/template
feat: implement initial read only access
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user