aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/common.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-03-19 16:20:38 +0100
committerRobin Appelman <robin@icewind.nl>2015-03-19 16:20:38 +0100
commit73874ca27f102b40f40df70367e01a4045a17b3e (patch)
tree7f92975f05831748d873a5dec4c259100e51fbf0 /lib/private/files/storage/common.php
parentbe6edd465a5a77ea859661feaedbeacd5a66f9db (diff)
parent7ab919256b066970a0a7139ab19bcdae5773c036 (diff)
downloadnextcloud-server-73874ca27f102b40f40df70367e01a4045a17b3e.tar.gz
nextcloud-server-73874ca27f102b40f40df70367e01a4045a17b3e.zip
Merge pull request #14704 from owncloud/storage-wrapper-mount
pass mountpoint to storage wrapper callback
Diffstat (limited to 'lib/private/files/storage/common.php')
-rw-r--r--lib/private/files/storage/common.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 5de243e177a..11cf3405fd9 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -35,6 +35,8 @@ abstract class Common implements \OC\Files\Storage\Storage {
protected $watcher;
protected $storageCache;
+ protected $mountOptions = [];
+
/**
* @var string[]
*/
@@ -330,7 +332,8 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
if (!isset($this->watcher)) {
$this->watcher = new Watcher($storage);
- $this->watcher->setPolicy(\OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_ONCE));
+ $globalPolicy = \OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_ONCE);
+ $this->watcher->setPolicy($this->getMountOption('filesystem_check_changes', $globalPolicy));
}
return $this->watcher;
}
@@ -517,4 +520,20 @@ abstract class Common implements \OC\Files\Storage\Storage {
throw new InvalidCharacterInPathException();
}
}
+
+ /**
+ * @param array $options
+ */
+ public function setMountOptions(array $options) {
+ $this->mountOptions = $options;
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $default
+ * @return mixed
+ */
+ public function getMountOption($name, $default = null) {
+ return isset($this->mountOptions[$name]) ? $this->mountOptions[$name] : $default;
+ }
}