* Update the cache and propagate changes
*/
class Updater {
+ /**
+ * @var bool
+ */
+ protected $enabled = true;
+
/**
* @var \OC\Files\View
*/
$this->propagator = new ChangePropagator($view);
}
+ public function disable() {
+ $this->enabled = false;
+ }
+
+ public function enable() {
+ $this->enabled = true;
+ }
+
public function propagate($path, $time = null) {
if (Scanner::isPartialFile($path)) {
return;
* @param int $time
*/
public function update($path, $time = null) {
- if (Scanner::isPartialFile($path)) {
+ if (!$this->enabled or Scanner::isPartialFile($path)) {
return;
}
/**
* @param string $path
*/
public function remove($path) {
- if (Scanner::isPartialFile($path)) {
+ if (!$this->enabled or Scanner::isPartialFile($path)) {
return;
}
/**
* @param string $target
*/
public function rename($source, $target) {
- if (Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) {
+ if (!$this->enabled or Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) {
return;
}
/**