summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-11-17 14:18:08 +0100
committerRobin Appelman <robin@icewind.nl>2016-11-17 18:48:38 +0100
commit065753f0ae39cfee229cefb612ca8243b9bae6ca (patch)
tree482b410f0f61d1cbb6556c59a41353f43151a762
parent14cdeafc3e6ec592becc60ca169cd4077568d138 (diff)
downloadnextcloud-server-065753f0ae39cfee229cefb612ca8243b9bae6ca.tar.gz
nextcloud-server-065753f0ae39cfee229cefb612ca8243b9bae6ca.zip
dont use the source cache/storage until needed
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_sharing/lib/Cache.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 21f3ff622f9..49765a7aab5 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -43,38 +43,32 @@ class Cache extends CacheJail {
private $storage;
/**
- * @var IStorage
- */
- private $sourceStorage;
-
- /**
* @var ICacheEntry
*/
private $sourceRootInfo;
- /**
- * @var \OCP\Files\Cache\ICache
- */
- private $sourceCache;
-
private $rootUnchanged = true;
/**
* @param \OCA\Files_Sharing\SharedStorage $storage
- * @param IStorage $sourceStorage
* @param ICacheEntry $sourceRootInfo
*/
- public function __construct($storage, IStorage $sourceStorage, ICacheEntry $sourceRootInfo) {
+ public function __construct($storage, ICacheEntry $sourceRootInfo) {
$this->storage = $storage;
- $this->sourceStorage = $sourceStorage;
$this->sourceRootInfo = $sourceRootInfo;
- $this->sourceCache = $sourceStorage->getCache();
parent::__construct(
- $this->sourceCache,
+ null,
$this->sourceRootInfo->getPath()
);
}
+ public function getCache() {
+ if (is_null($this->cache)) {
+ $this->cache = $this->storage->getSourceStorage()->getCache();
+ }
+ return $this->cache;
+ }
+
public function getNumericStorageId() {
if (isset($this->numericId)) {
return $this->numericId;