diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-22 20:18:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-22 20:18:21 +0100 |
commit | e5d77822c899f5d62d7fbdececc548317542fe28 (patch) | |
tree | dfd4d3126c6172a2e71ae15eb283e5c0a4d7ede7 /lib | |
parent | bb93be214797a2101700585392679bfc19dc0fc4 (diff) | |
parent | f0bef8881dd9861c615f56da058a165c2cc5ce86 (diff) | |
download | nextcloud-server-e5d77822c899f5d62d7fbdececc548317542fe28.tar.gz nextcloud-server-e5d77822c899f5d62d7fbdececc548317542fe28.zip |
Merge pull request #18442 from nextcloud/bugfix/noid/broken_appstoreurl_config
Restore old behavior allowing to set custom appstore
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/AppFetcher.php | 5 | ||||
-rw-r--r-- | lib/private/App/AppStore/Fetcher/CategoryFetcher.php | 1 | ||||
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 8 |
3 files changed, 5 insertions, 9 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 49faa64bb50..d97949421d8 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -68,7 +68,6 @@ class AppFetcher extends Fetcher { ); $this->fileName = 'apps.json'; - $this->setEndpoint(); $this->compareVersion = $compareVersion; $this->ignoreMaxVersion = true; } @@ -143,10 +142,6 @@ class AppFetcher extends Fetcher { return $response; } - private function setEndpoint() { - $this->endpointUrl = 'https://apps.nextcloud.com/api/v1/apps.json'; - } - /** * @param string $version * @param string $fileName diff --git a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php index 7fa0800762a..904c401c153 100644 --- a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php +++ b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php @@ -53,6 +53,5 @@ class CategoryFetcher extends Fetcher { $logger ); $this->fileName = 'categories.json'; - $this->endpointUrl = 'https://apps.nextcloud.com/api/v1/categories.json'; } } diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index bcfea94959c..76a37bfa7de 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -55,8 +55,6 @@ abstract class Fetcher { /** @var string */ protected $fileName; /** @var string */ - protected $endpointUrl; - /** @var string */ protected $version; /** @var string */ protected $channel; @@ -106,7 +104,7 @@ abstract class Fetcher { } $client = $this->clientService->newClient(); - $response = $client->get($this->endpointUrl, $options); + $response = $client->get($this->getEndpoint(), $options); $responseJson = []; if ($response->getStatusCode() === Http::STATUS_NOT_MODIFIED) { @@ -219,4 +217,8 @@ abstract class Fetcher { public function setChannel(string $channel) { $this->channel = $channel; } + + protected function getEndpoint(): string { + return $this->config->getSystemValue('appstoreurl', 'https://apps.nextcloud.com/api/v1') . '/' . $this->fileName; + } } |