summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-04-15 14:03:48 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-04-19 14:04:00 +0200
commit2f1c62ce0b022a2549ff80a299b8a3b314106fae (patch)
tree9ddac98ce1f4ad51cff1bcfaa130b229665b7c31 /apps
parentc98fef8a51aa9828097db697fde2641771ed24c7 (diff)
downloadnextcloud-server-2f1c62ce0b022a2549ff80a299b8a3b314106fae.tar.gz
nextcloud-server-2f1c62ce0b022a2549ff80a299b8a3b314106fae.zip
Only construct the storage when we start using it
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/sharedmount.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php
index 624fbce3311..4aed80b12b2 100644
--- a/apps/files_sharing/lib/sharedmount.php
+++ b/apps/files_sharing/lib/sharedmount.php
@@ -49,6 +49,9 @@ class SharedMount extends MountPoint implements MoveableMount {
*/
private $user;
+ /** @var \OCP\Share\IShare */
+ private $share;
+
/**
* @param string $storage
* @param SharedMount[] $mountpoints
@@ -58,11 +61,10 @@ class SharedMount extends MountPoint implements MoveableMount {
public function __construct($storage, array $mountpoints, $arguments = null, $loader = null) {
$this->user = $arguments['user'];
$this->recipientView = new View('/' . $this->user . '/files');
- /** @var \OCP\Share\IShare $share */
- $share = $arguments['newShare'];
- $newMountPoint = $this->verifyMountPoint($share, $mountpoints);
+ $this->share = $arguments['newShare'];
+ $newMountPoint = $this->verifyMountPoint($this->share, $mountpoints);
$absMountPoint = '/' . $this->user . '/files' . $newMountPoint;
- $arguments['ownerView'] = new View('/' . $share->getShareOwner() . '/files');
+ $arguments['ownerView'] = new View('/' . $this->share->getShareOwner() . '/files');
parent::__construct($storage, $absMountPoint, $arguments, $loader);
}
@@ -210,8 +212,15 @@ class SharedMount extends MountPoint implements MoveableMount {
* @return \OCP\Share\IShare
*/
public function getShare() {
- /** @var $storage \OC\Files\Storage\Shared */
- $storage = $this->getStorage();
- return $storage->getShare();
+ return $this->share;
+ }
+
+ /**
+ * Get the file id of the root of the storage
+ *
+ * @return int
+ */
+ public function getStorageRootId() {
+ return $this->share->getNodeId();
}
}