summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-27 14:14:42 +0100
committerRobin Appelman <icewind@owncloud.com>2015-03-03 13:11:18 +0100
commitfa64ba356a4d259a001c77e877f1bb8b60c65442 (patch)
tree9883f2e6712ab5aa0efa7e81cc5e3ec4d9d8428e /lib/private
parent598c4fdcae23aeeb2e6a1f1eec29ffda5a04c65f (diff)
downloadnextcloud-server-fa64ba356a4d259a001c77e877f1bb8b60c65442.tar.gz
nextcloud-server-fa64ba356a4d259a001c77e877f1bb8b60c65442.zip
Allow disabling the cache updater
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/files/cache/updater.php21
-rw-r--r--lib/private/files/view.php7
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index 2ddee57c787..09040e9522a 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -13,6 +13,11 @@ namespace OC\Files\Cache;
*/
class Updater {
/**
+ * @var bool
+ */
+ protected $enabled = true;
+
+ /**
* @var \OC\Files\View
*/
protected $view;
@@ -30,6 +35,14 @@ class Updater {
$this->propagator = new ChangePropagator($view);
}
+ public function disable() {
+ $this->enabled = false;
+ }
+
+ public function enable() {
+ $this->enabled = true;
+ }
+
public function propagate($path, $time = null) {
$this->propagator->addChange($path);
$this->propagator->propagateChanges($time);
@@ -42,7 +55,7 @@ class Updater {
* @param int $time
*/
public function update($path, $time = null) {
- if (Scanner::isPartialFile($path)) {
+ if (!$this->enabled or Scanner::isPartialFile($path)) {
return;
}
/**
@@ -67,6 +80,9 @@ class Updater {
* @param string $path
*/
public function remove($path) {
+ if (!$this->enabled) {
+ return;
+ }
/**
* @var \OC\Files\Storage\Storage $storage
* @var string $internalPath
@@ -91,6 +107,9 @@ class Updater {
* @param string $target
*/
public function rename($source, $target) {
+ if (!$this->enabled) {
+ return;
+ }
/**
* @var \OC\Files\Storage\Storage $sourceStorage
* @var \OC\Files\Storage\Storage $targetStorage
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index d877d8dafaa..b5ad425a0fa 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1408,4 +1408,11 @@ class View {
$mount
);
}
+
+ /**
+ * @return Updater
+ */
+ public function getUpdater(){
+ return $this->updater;
+ }
}