diff options
Diffstat (limited to 'lib/private/files/storage')
-rw-r--r-- | lib/private/files/storage/common.php | 12 | ||||
-rw-r--r-- | lib/private/files/storage/storage.php | 8 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/wrapper.php | 7 |
3 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 3772b442b59..0cd67e343ff 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -39,6 +39,7 @@ 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; @@ -67,6 +68,7 @@ abstract class Common implements Storage { protected $watcher; protected $propagator; protected $storageCache; + protected $updater; protected $mountOptions = []; @@ -363,6 +365,16 @@ abstract class Common implements 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; diff --git a/lib/private/files/storage/storage.php b/lib/private/files/storage/storage.php index 3399c717890..fb59752ede1 100644 --- a/lib/private/files/storage/storage.php +++ b/lib/private/files/storage/storage.php @@ -76,6 +76,14 @@ interface Storage extends \OCP\Files\Storage { public function getPropagator($storage = null); /** + * get a updater instance for the cache + * + * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher + * @return \OC\Files\Cache\Updater + */ + public function getUpdater($storage = null); + + /** * @return \OC\Files\Cache\Storage */ public function getStorageCache(); diff --git a/lib/private/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php index 5327b94211b..81284c7aa69 100644 --- a/lib/private/files/storage/wrapper/wrapper.php +++ b/lib/private/files/storage/wrapper/wrapper.php @@ -437,6 +437,13 @@ class Wrapper implements \OC\Files\Storage\Storage { return $this->storage->getPropagator($storage); } + public function getUpdater($storage = null) { + if (!$storage) { + $storage = $this; + } + return $this->storage->getUpdater($storage); + } + /** * @return \OC\Files\Cache\Storage */ |