summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/storage/common.php')
-rw-r--r--lib/private/files/storage/common.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 77a70226b37..0cd67e343ff 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -37,7 +37,9 @@
namespace OC\Files\Storage;
use OC\Files\Cache\Cache;
+use OC\Files\Cache\Propagator;
use OC\Files\Cache\Scanner;
+use OC\Files\Cache\Updater;
use OC\Files\Filesystem;
use OC\Files\Cache\Watcher;
use OCP\Files\FileNameTooLongException;
@@ -64,7 +66,9 @@ abstract class Common implements Storage {
protected $cache;
protected $scanner;
protected $watcher;
+ protected $propagator;
protected $storageCache;
+ protected $updater;
protected $mountOptions = [];
@@ -137,7 +141,7 @@ abstract class Common implements Storage {
}
public function isSharable($path) {
- if (\OC_Util::isSharingDisabledForUser()) {
+ if (\OCP\Util::isSharingDisabledForUser()) {
return false;
}
@@ -345,6 +349,32 @@ abstract class Common implements Storage {
return $this->watcher;
}
+ /**
+ * get a propagator instance for the cache
+ *
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
+ * @return \OC\Files\Cache\Propagator
+ */
+ public function getPropagator($storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ if (!isset($this->propagator)) {
+ $this->propagator = new Propagator($storage);
+ }
+ return $this->propagator;
+ }
+
+ public function getUpdater($storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ if (!isset($this->updater)) {
+ $this->updater = new Updater($storage);
+ }
+ return $this->updater;
+ }
+
public function getStorageCache($storage = null) {
if (!$storage) {
$storage = $this;