summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-02-24 10:07:25 +0100
committerGitHub <noreply@github.com>2017-02-24 10:07:25 +0100
commitd0980bec73858b0fe9795a8dfae1118e4bebd2a3 (patch)
treef524264fc4ffe91e491a60b8d3ff01cf0cd18dcd /lib
parent5e9a2c29b38b6dd3cdb2f95ed20f7e7eb2d2fb5d (diff)
parentf3bfacc976c2e0969f52c162120273e81730a817 (diff)
downloadnextcloud-server-d0980bec73858b0fe9795a8dfae1118e4bebd2a3.tar.gz
nextcloud-server-d0980bec73858b0fe9795a8dfae1118e4bebd2a3.zip
Merge pull request #3287 from nextcloud/readd_appstoreenabled_switch
Add back appstoreenabled config switch
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index dab79e11821..ab0e299f0a2 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -69,6 +69,12 @@ abstract class Fetcher {
* @return array
*/
protected function fetch($ETag, $content) {
+ $appstoreenabled = $this->config->getSystemValue('appstoreenabled', true);
+
+ if (!$appstoreenabled) {
+ return [];
+ }
+
$options = [];
if ($ETag !== '') {
@@ -102,7 +108,13 @@ abstract class Fetcher {
*
* @return array
*/
- public function get() {
+ public function get() {
+ $appstoreenabled = $this->config->getSystemValue('appstoreenabled', true);
+
+ if (!$appstoreenabled) {
+ return [];
+ }
+
$rootFolder = $this->appData->getFolder('/');
$ETag = '';
@@ -112,13 +124,14 @@ abstract class Fetcher {
// File does already exists
$file = $rootFolder->getFile($this->fileName);
$jsonBlob = json_decode($file->getContent(), true);
- if(is_array($jsonBlob)) {
+ if (is_array($jsonBlob)) {
/*
* If the timestamp is older than 300 seconds request the files new
* If the version changed (update!) also refresh
*/
- if((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
- isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')) {
+ if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
+ isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')
+ ) {
return $jsonBlob['data'];
}