Make the change propagator an emitter

This commit is contained in:
Robin Appelman 2015-03-09 16:15:06 +01:00
parent 2dc11cf20e
commit 849e5521de
2 changed files with 8 additions and 1 deletions

View File

@ -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]);
}
}
}

View File

@ -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;