diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-03-09 16:15:06 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-04-27 14:07:15 +0200 |
commit | 849e5521de2afdf6efbcb70337079a50f012a6ce (patch) | |
tree | 18132fd888097737fcf95f107d0989f372eecf74 /lib/private/files/cache | |
parent | 2dc11cf20e85e9f47c0a2e7027e1229b41c46e6d (diff) | |
download | nextcloud-server-849e5521de2afdf6efbcb70337079a50f012a6ce.tar.gz nextcloud-server-849e5521de2afdf6efbcb70337079a50f012a6ce.zip |
Make the change propagator an emitter
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r-- | lib/private/files/cache/changepropagator.php | 5 | ||||
-rw-r--r-- | lib/private/files/cache/updater.php | 4 |
2 files changed, 8 insertions, 1 deletions
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; |