diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-10 16:17:29 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-10 16:17:29 +0100 |
commit | 80ae311329f56295e9ec6a4d3cee66cb9afc1a4f (patch) | |
tree | 24ca0805d06f7af4da69ecf635d77c6f40041ee1 /lib | |
parent | 3898fbc0d2d65785b8b132645c5bf99077d16818 (diff) | |
parent | 0f17486c1d6d974e25ea75597bd2ca6f50e5e538 (diff) | |
download | nextcloud-server-80ae311329f56295e9ec6a4d3cee66cb9afc1a4f.tar.gz nextcloud-server-80ae311329f56295e9ec6a4d3cee66cb9afc1a4f.zip |
Merge pull request #11892 from owncloud/remove_triggerupdate
Remove triggerupdate.php & add quiet option for CLI scanner
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/cache/scanner.php | 6 | ||||
-rw-r--r-- | lib/private/files/utils/scanner.php | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 444207518b2..a5383cee10d 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -219,8 +219,10 @@ class Scanner extends BasicEmitter { $reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : 0; } $data = $this->scanFile($path, $reuse); - $size = $this->scanChildren($path, $recursive, $reuse); - $data['size'] = $size; + if ($data !== null) { + $size = $this->scanChildren($path, $recursive, $reuse); + $data['size'] = $size; + } return $data; } diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index 19a2ed38e1b..662d4ac03c7 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -114,7 +114,7 @@ class Scanner extends PublicEmitter { * @param string $dir * @throws \OC\ForbiddenException */ - public function scan($dir) { + public function scan($dir = '') { $mounts = $this->getMounts($dir); foreach ($mounts as $mount) { if (is_null($mount->getStorage())) { @@ -127,11 +127,12 @@ class Scanner extends PublicEmitter { ) { throw new ForbiddenException(); } + $relativePath = $mount->getInternalPath($dir); $scanner = $storage->getScanner(); $scanner->setUseTransactions(false); $this->attachListener($mount); $this->db->beginTransaction(); - $scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); + $scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); $this->db->commit(); } $this->propagator->propagateChanges(time()); |