Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-11-07 19:22:29 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-28 19:35:58 +0400
commitf0f0be8b2b58b056c29410596b4a744a5b3b52f7 (patch)
treedb1fbe2ea293b2e831576e65c7ad78d1df960940 /lib/files
parentad770024b6fdcb79457b7f8600625d2c9f031a9b (diff)
Add post hooks for filesystem scanner
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/cache/scanner.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index af819c47c61..429685ce794 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/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
*/
@@ -141,6 +143,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);
@@ -227,6 +231,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;
}