diff options
author | Blaok <i@blaok.me> | 2018-05-18 14:50:32 -0700 |
---|---|---|
committer | Blaok <i@blaok.me> | 2018-05-18 14:50:32 -0700 |
commit | 21b9ad397817af96d6d4204642debd263233bdda (patch) | |
tree | 94b15267325722463ccb0485303f94aab5a5679c /lib/private/Files/Utils/Scanner.php | |
parent | 03a6f8e14e63a0abcf4ed8fbca12998bcbb59be3 (diff) | |
download | nextcloud-server-21b9ad397817af96d6d4204642debd263233bdda.tar.gz nextcloud-server-21b9ad397817af96d6d4204642debd263233bdda.zip |
feat: allow files:scan --shallow
Signed-off-by: Yuze Chi <i@blaok.me>
Diffstat (limited to 'lib/private/Files/Utils/Scanner.php')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index dd20e11fb63..f91696e77bb 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -185,7 +185,7 @@ class Scanner extends PublicEmitter { * @throws \OC\ForbiddenException * @throws \OCP\Files\NotFoundException */ - public function scan($dir = '') { + public function scan($dir = '', $recursive = \OC\Files\Cache\Scanner::SCAN_RECURSIVE) { if (!Filesystem::isValidPath($dir)) { throw new \InvalidArgumentException('Invalid path to scan'); } @@ -242,7 +242,7 @@ class Scanner extends PublicEmitter { try { $propagator = $storage->getPropagator(); $propagator->beginBatch(); - $scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); + $scanner->scan($relativePath, $recursive, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); $cache = $storage->getCache(); if ($cache instanceof Cache) { // only re-calculate for the root folder we scanned, anything below that is taken care of by the scanner |