Make the change propagator an emitter

remotes/origin/poc-doctrine-migrations
Robin Appelman 11 years ago
parent 2dc11cf20e
commit 849e5521de
  1. 5
      lib/private/files/cache/changepropagator.php
  2. 4
      lib/private/files/cache/updater.php

@ -22,12 +22,14 @@
namespace OC\Files\Cache;
use OC\Hooks\BasicEmitter;
/**
* Propagates changes in etag and mtime up the filesystem tree
*
* @package OC\Files\Cache
*/
class ChangePropagator {
class ChangePropagator extends BasicEmitter {
/**
* @var string[]
*/
@ -75,6 +77,7 @@ class ChangePropagator {
$cache = $storage->getCache();
$entry = $cache->get($internalPath);
$cache->update($entry['fileid'], array('mtime' => max($time, $entry['mtime']), 'etag' => $storage->getETag($internalPath)));
$this->emit('\OC\Files', 'propagate', [$parent, $entry]);
}
}
}

@ -60,6 +60,10 @@ class Updater {
$this->enabled = true;
}
public function getPropagator() {
return $this->propagator;
}
public function propagate($path, $time = null) {
if (Scanner::isPartialFile($path)) {
return;

Loading…
Cancel
Save