From 849e5521de2afdf6efbcb70337079a50f012a6ce Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 9 Mar 2015 16:15:06 +0100 Subject: Make the change propagator an emitter --- lib/private/files/cache/changepropagator.php | 5 ++++- lib/private/files/cache/updater.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/private/files/cache') diff --git a/lib/private/files/cache/changepropagator.php b/lib/private/files/cache/changepropagator.php index 4a860631ae0..9696a82257e 100644 --- a/lib/private/files/cache/changepropagator.php +++ b/lib/private/files/cache/changepropagator.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]); } } } diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 14aecf01220..66345350168 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -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; -- cgit v1.2.3