diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-11-07 12:44:23 -0800 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-11-07 12:44:23 -0800 |
commit | 4459d964d6af1f9a1c12e3132b8609fc0f40dc98 (patch) | |
tree | 936322a06e7fec508c52d093d32e396c3033448f | |
parent | 013444813e106dcc5ed45cb709696d5d6e24e89a (diff) | |
parent | d6845babd62d8a813ce8dbc7e71652cd55db8e47 (diff) | |
download | nextcloud-server-4459d964d6af1f9a1c12e3132b8609fc0f40dc98.tar.gz nextcloud-server-4459d964d6af1f9a1c12e3132b8609fc0f40dc98.zip |
Merge pull request #5747 from owncloud/scanner-post-hooks
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; } |