diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-11-07 16:22:29 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-11-07 16:22:29 +0100 |
commit | d6845babd62d8a813ce8dbc7e71652cd55db8e47 (patch) | |
tree | c028966bc133a05615fd6320f22b3c5f41d11dae | |
parent | 3e916a9f1db72696681415797adad49db19b538b (diff) | |
download | nextcloud-server-d6845babd62d8a813ce8dbc7e71652cd55db8e47.tar.gz nextcloud-server-d6845babd62d8a813ce8dbc7e71652cd55db8e47.zip |
Add post hooks for filesystem scanner
-rw-r--r-- | lib/private/files/cache/scanner.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 17f99d675ae..34184c68c64 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -17,6 +17,8 @@ use OC\Hooks\BasicEmitter; * Hooks available in scope \OC\Files\Cache\Scanner: * - scanFile(string $path, string $storageId) * - scanFolder(string $path, string $storageId) + * - postScanFile(string $path, string $storageId) + * - postScanFolder(string $path, string $storageId) * * @package OC\Files\Cache */ @@ -154,6 +156,8 @@ class Scanner extends BasicEmitter { } if (!empty($newData)) { $this->cache->put($file, $newData); + $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId)); + \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } } else { $this->cache->remove($file); @@ -258,6 +262,7 @@ class Scanner extends BasicEmitter { } $this->cache->put($path, array('size' => $size)); } + $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', array($path, $this->storageId)); return $size; } |