Cache: simplify scanner logic a bit when handeling with unknown folder sizes
This commit is contained in:
parent
4a130d106c
commit
56d10e9054
|
@ -101,18 +101,16 @@ class Scanner {
|
|||
$child = ($path) ? $path . '/' . $file : $file;
|
||||
$data = $this->scanFile($child);
|
||||
if ($data) {
|
||||
if ($data['mimetype'] === 'httpd/unix-directory') {
|
||||
if ($data['size'] === -1) {
|
||||
if ($recursive === self::SCAN_RECURSIVE) {
|
||||
$childQueue[] = $child;
|
||||
$data['size'] = 0;
|
||||
} else {
|
||||
$data['size'] = -1;
|
||||
$size = -1;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if ($data['size'] === -1) {
|
||||
$size = -1;
|
||||
} elseif ($size !== -1) {
|
||||
|
||||
if ($size !== -1) {
|
||||
$size += $data['size'];
|
||||
}
|
||||
}
|
||||
|
@ -143,8 +141,8 @@ class Scanner {
|
|||
*/
|
||||
private function isIgnoredFile($file) {
|
||||
if ($file === '.' || $file === '..'
|
||||
|| pathinfo($file,PATHINFO_EXTENSION) === 'part')
|
||||
{
|
||||
|| pathinfo($file, PATHINFO_EXTENSION) === 'part'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue