summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-01 18:04:29 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-01 18:04:29 +0100
commitb41189de4420ea8a48adaaf7bb59f9227124b70a (patch)
tree9d0c46104770ee54d738c047d672a0854cb8585a /lib/files
parentf2ca7023e1ece60dc3cebc5cd770c7373f53c93a (diff)
downloadnextcloud-server-b41189de4420ea8a48adaaf7bb59f9227124b70a.tar.gz
nextcloud-server-b41189de4420ea8a48adaaf7bb59f9227124b70a.zip
Cache: allow storage backends to overwrite Watcher
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/storage/common.php7
-rw-r--r--lib/files/storage/storage.php5
-rw-r--r--lib/files/view.php4
3 files changed, 14 insertions, 2 deletions
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index 3cf960d05df..ab167f28646 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -250,6 +250,13 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
/**
+ * @return \OC\Files\Cache\Watcher
+ */
+ public function getWatcher(){
+ return new \OC\Files\Cache\Watcher($this);
+ }
+
+ /**
* get the owner of a path
* @param string $path The path to get the owner
* @return string uid or false
diff --git a/lib/files/storage/storage.php b/lib/files/storage/storage.php
index 73dcb8fe36b..b603381dc90 100644
--- a/lib/files/storage/storage.php
+++ b/lib/files/storage/storage.php
@@ -70,6 +70,11 @@ interface Storage{
public function getPermissionsCache();
/**
+ * @return \OC\Files\Cache\Watcher
+ */
+ public function getWatcher();
+
+ /**
* get the ETag for a file or folder
*
* @param string $path
diff --git a/lib/files/view.php b/lib/files/view.php
index 592c484a21c..d3f93d39f5a 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -685,7 +685,7 @@ class View {
$scanner = $storage->getScanner();
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
} else {
- $watcher = new \OC\Files\Cache\Watcher($storage);
+ $watcher = $storage->getWatcher();
$watcher->checkUpdate($internalPath);
}
@@ -733,7 +733,7 @@ class View {
$scanner = $storage->getScanner();
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
} else {
- $watcher = new \OC\Files\Cache\Watcher($storage);
+ $watcher = $storage->getWatcher();
$watcher->checkUpdate($internalPath);
}