diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-10 15:37:21 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-11 15:04:01 +0200 |
commit | 449011dae7ea0ec7eb8d6c78e89709982020e709 (patch) | |
tree | e102862917001ace40e23d7126973612cf7f2ac6 /lib | |
parent | 0dea31d48bbd0361cca4d67b9de05a9f9ad3a198 (diff) | |
download | nextcloud-server-449011dae7ea0ec7eb8d6c78e89709982020e709.tar.gz nextcloud-server-449011dae7ea0ec7eb8d6c78e89709982020e709.zip |
remove discovery manager in favour of the OCSDiscoveryService
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share/Share.php | 8 | ||||
-rw-r--r-- | lib/private/Share20/ProviderFactory.php | 6 | ||||
-rw-r--r-- | lib/public/IServerContainer.php | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 924e2f68396..2b4a57b89a4 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -2742,12 +2742,10 @@ class Share extends Constants { 'result' => '', ]; $try = 0; - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); + $discoveryService = \OC::$server->getOCSDiscoveryService(); while ($result['success'] === false && $try < 2) { - $endpoint = $discoveryManager->getShareEndpoint($protocol . $remoteDomain); + $federationEndpoints = $discoveryService->discover($protocol . $remoteDomain, 'FEDERATED_SHARING'); + $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; $result = \OC::$server->getHTTPHelper()->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, $fields); $try++; $protocol = 'http://'; diff --git a/lib/private/Share20/ProviderFactory.php b/lib/private/Share20/ProviderFactory.php index b411f42b262..5eb34a483e7 100644 --- a/lib/private/Share20/ProviderFactory.php +++ b/lib/private/Share20/ProviderFactory.php @@ -104,14 +104,10 @@ class ProviderFactory implements IProviderFactory { $l, $this->serverContainer->getCloudIdManager() ); - $discoveryManager = new DiscoveryManager( - $this->serverContainer->getMemCacheFactory(), - $this->serverContainer->getHTTPClientService() - ); $notifications = new Notifications( $addressHandler, $this->serverContainer->getHTTPClientService(), - $discoveryManager, + $this->serverContainer->getOCSDiscoveryService(), $this->serverContainer->getJobList() ); $tokenHandler = new TokenHandler( diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index 8c74c05d801..4d084aae79e 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -531,4 +531,10 @@ interface IServerContainer extends IContainer { * @since 12.0.0 */ public function getCloudIdManager(); + + /** + * @return \OC\OCS\DiscoveryService + * @since 12.0.0 + */ + public function getOCSDiscoveryService(); } |