diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-03 13:07:19 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-03 13:07:19 +0200 |
commit | b9b9fd9dbaae47b3a15aed9694c18b95404550b0 (patch) | |
tree | 4fc37a4667a56f9595fad9caafac3f89ee282fc5 /lib/files/cache | |
parent | 85be00be6595a3af168f6df963ffdeac8c3c6d5e (diff) | |
download | nextcloud-server-b9b9fd9dbaae47b3a15aed9694c18b95404550b0.tar.gz nextcloud-server-b9b9fd9dbaae47b3a15aed9694c18b95404550b0.zip |
more tests and fixes for the filesystem scanner
Diffstat (limited to 'lib/files/cache')
-rw-r--r-- | lib/files/cache/scanner.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 7d449204e81..e8f54c34be7 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -86,15 +86,24 @@ class Scanner { if ($file !== '.' and $file !== '..') { $child = ($path !== '') ? $path . '/' . $file : $file; $data = $this->scanFile($child); - if ($recursive === self::SCAN_RECURSIVE and $data['mimetype'] === 'httpd/unix-directory') { - $data['size'] = $this->scan($child, self::SCAN_RECURSIVE); + if ($data['mimetype'] === 'httpd/unix-directory') { + if ($recursive === self::SCAN_RECURSIVE) { + $data['size'] = $this->scan($child, self::SCAN_RECURSIVE); + } else { + $data['size'] = -1; + } } - if ($data['size'] >= 0 and $size >= 0) { + if ($data['size'] === -1) { + $size = -1; + } elseif ($size !== -1) { $size += $data['size']; } } } } + if ($size !== -1) { + $this->cache->put($path, array('size' => $size)); + } return $size; } } |