summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-11-07 12:44:23 -0800
committerMorris Jobke <morris.jobke@gmail.com>2013-11-07 12:44:23 -0800
commit4459d964d6af1f9a1c12e3132b8609fc0f40dc98 (patch)
tree936322a06e7fec508c52d093d32e396c3033448f
parent013444813e106dcc5ed45cb709696d5d6e24e89a (diff)
parentd6845babd62d8a813ce8dbc7e71652cd55db8e47 (diff)
downloadnextcloud-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.php5
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;
}