summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Douma <rullzer@users.noreply.github.com>2016-05-30 08:12:01 +0200
committerRoeland Douma <rullzer@users.noreply.github.com>2016-05-30 08:12:01 +0200
commite20c49dab6db83d8d0634b250461c58da9cc94ed (patch)
tree107c8889c90ae94231c9ffc1c69eb96100732a13
parentc6acbb4e8b8f6f4905047427a2063a45862af9e8 (diff)
parent7f9b28f2c1a867b515c2b59349da9a141abd255c (diff)
downloadnextcloud-server-e20c49dab6db83d8d0634b250461c58da9cc94ed.tar.gz
nextcloud-server-e20c49dab6db83d8d0634b250461c58da9cc94ed.zip
Merge pull request #24841 from owncloud/islocal-cache
[8.2] cache isLocal for shared storage
-rw-r--r--apps/files_sharing/lib/sharedstorage.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 1970e297252..dbf2fe05480 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -44,6 +44,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
private $share; // the shared resource
private $files = array();
private static $isInitialized = array();
+ private $local = null;
/**
* @var \OC\Files\View
@@ -705,9 +706,12 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
public function isLocal() {
- $this->init();
- $ownerPath = $this->ownerView->getPath($this->share['item_source']);
- list($targetStorage) = $this->ownerView->resolvePath($ownerPath);
- return $targetStorage->isLocal();
+ if (!is_null($this->local)) {
+ $this->init();
+ $ownerPath = $this->ownerView->getPath($this->share['item_source']);
+ list($targetStorage) = $this->ownerView->resolvePath($ownerPath);
+ $this->local = $targetStorage->isLocal();
+ }
+ return $this->local;
}
}