diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-03-05 12:28:17 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-03-11 15:06:12 +0100 |
commit | e5c8fd37df9a5727bdfdf3664390b911a67a617a (patch) | |
tree | b0e797ab6319e66d6b994743bff7d709c00f7dfb /lib/private/files | |
parent | dbade1936206256f55f89c3f865be4046b8fb546 (diff) | |
download | nextcloud-server-e5c8fd37df9a5727bdfdf3664390b911a67a617a.tar.gz nextcloud-server-e5c8fd37df9a5727bdfdf3664390b911a67a617a.zip |
pass mountpoint to storage wrapper callback
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/mount/mountpoint.php | 6 | ||||
-rw-r--r-- | lib/private/files/storage/storagefactory.php | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/files/mount/mountpoint.php b/lib/private/files/mount/mountpoint.php index 85edb7cb570..0442a369039 100644 --- a/lib/private/files/mount/mountpoint.php +++ b/lib/private/files/mount/mountpoint.php @@ -71,9 +71,10 @@ class MountPoint implements IMountPoint { } $mountpoint = $this->formatPath($mountpoint); + $this->mountPoint = $mountpoint; if ($storage instanceof Storage) { $this->class = get_class($storage); - $this->storage = $this->loader->wrap($mountpoint, $storage); + $this->storage = $this->loader->wrap($this, $storage); } else { // Update old classes to new namespace if (strpos($storage, 'OC_Filestorage_') !== false) { @@ -82,7 +83,6 @@ class MountPoint implements IMountPoint { $this->class = $storage; $this->arguments = $arguments; } - $this->mountPoint = $mountpoint; } /** @@ -113,7 +113,7 @@ class MountPoint implements IMountPoint { if (class_exists($this->class)) { try { - return $this->loader->getInstance($this->mountPoint, $this->class, $this->arguments); + return $this->loader->getInstance($this, $this->class, $this->arguments); } catch (\Exception $exception) { $this->invalidStorage = true; if ($this->mountPoint === '/') { diff --git a/lib/private/files/storage/storagefactory.php b/lib/private/files/storage/storagefactory.php index fa6dea2537c..b43a6f737c0 100644 --- a/lib/private/files/storage/storagefactory.php +++ b/lib/private/files/storage/storagefactory.php @@ -8,6 +8,8 @@ namespace OC\Files\Storage; +use OCP\Files\Config\IMountProviderCollection; +use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IStorageFactory; class StorageFactory implements IStorageFactory { @@ -55,23 +57,23 @@ class StorageFactory implements IStorageFactory { /** * Create an instance of a storage and apply the registered storage wrappers * - * @param string|boolean $mountPoint + * @param \OCP\Files\Mount\IMountPoint $mountPoint * @param string $class * @param array $arguments * @return \OCP\Files\Storage */ - public function getInstance($mountPoint, $class, $arguments) { + public function getInstance(IMountPoint $mountPoint, $class, $arguments) { return $this->wrap($mountPoint, new $class($arguments)); } /** - * @param string|boolean $mountPoint + * @param \OCP\Files\Mount\IMountPoint $mountPoint * @param \OCP\Files\Storage $storage * @return \OCP\Files\Storage */ - public function wrap($mountPoint, $storage) { + public function wrap(IMountPoint $mountPoint, $storage) { foreach ($this->storageWrappers as $wrapper) { - $storage = $wrapper($mountPoint, $storage); + $storage = $wrapper($mountPoint->getMountPoint(), $storage, $mountPoint); } return $storage; } |