@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | // find any path marked as unscanned and run the scanner until no more paths are unscanned (or we get stuck) |
| 49 | 49 | // we sort by path DESC to ensure that contents of a folder are handled before the parent folder |
| 50 | 50 | while (($path = $this->getIncomplete()) !== false && $path !== $lastPath) { |
| 51 | - $this->runBackgroundScanJob(function () use ($path) { |
|
| 51 | + $this->runBackgroundScanJob(function() use ($path) { |
|
| 52 | 52 | $item = $this->cache->get($path); |
| 53 | 53 | if ($item && $item->getMimeType() !== FileInfo::MIMETYPE_FOLDER) { |
| 54 | 54 | $fh = $this->storage->fopen($path, 'r'); |
@@ -93,6 +93,6 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Make sure Oracle does not continue with null for empty strings |
| 96 | - return (string)$path; |
|
| 96 | + return (string) $path; |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | if ($lock) { |
| 338 | 338 | if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
| 339 | - $this->storage->acquireLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 339 | + $this->storage->acquireLock('scanner::'.$path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 340 | 340 | $this->storage->acquireLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider); |
| 341 | 341 | } |
| 342 | 342 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | if ($lock) { |
| 356 | 356 | if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
| 357 | 357 | $this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider); |
| 358 | - $this->storage->releaseLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 358 | + $this->storage->releaseLock('scanner::'.$path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -448,14 +448,14 @@ discard block |
||
| 448 | 448 | $file = trim(\OC\Files\Filesystem::normalizePath($originalFile), '/'); |
| 449 | 449 | if (trim($originalFile, '/') !== $file) { |
| 450 | 450 | // encoding mismatch, might require compatibility wrapper |
| 451 | - \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "'. $originalFile . '" in path "' . $path . '".', ['app' => 'core']); |
|
| 452 | - $this->emit('\OC\Files\Cache\Scanner', 'normalizedNameMismatch', [$path ? $path . '/' . $originalFile : $originalFile]); |
|
| 451 | + \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "'.$originalFile.'" in path "'.$path.'".', ['app' => 'core']); |
|
| 452 | + $this->emit('\OC\Files\Cache\Scanner', 'normalizedNameMismatch', [$path ? $path.'/'.$originalFile : $originalFile]); |
|
| 453 | 453 | // skip this entry |
| 454 | 454 | continue; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | $newChildNames[] = $file; |
| 458 | - $child = $path ? $path . '/' . $file : $file; |
|
| 458 | + $child = $path ? $path.'/'.$file : $file; |
|
| 459 | 459 | try { |
| 460 | 460 | $existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : false; |
| 461 | 461 | $data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock, $fileMeta); |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | $this->connection->rollback(); |
| 480 | 480 | $this->connection->beginTransaction(); |
| 481 | 481 | } |
| 482 | - \OC::$server->get(LoggerInterface::class)->debug('Exception while scanning file "' . $child . '"', [ |
|
| 482 | + \OC::$server->get(LoggerInterface::class)->debug('Exception while scanning file "'.$child.'"', [ |
|
| 483 | 483 | 'app' => 'core', |
| 484 | 484 | 'exception' => $ex, |
| 485 | 485 | ]); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | $removedChildren = \array_diff(array_keys($existingChildren), $newChildNames); |
| 495 | 495 | foreach ($removedChildren as $childName) { |
| 496 | - $child = $path ? $path . '/' . $childName : $childName; |
|
| 496 | + $child = $path ? $path.'/'.$childName : $childName; |
|
| 497 | 497 | $this->removeFromCache($child); |
| 498 | 498 | } |
| 499 | 499 | if ($this->useTransactions) { |
@@ -543,14 +543,14 @@ discard block |
||
| 543 | 543 | } else { |
| 544 | 544 | if (!$this->cache->inCache('')) { |
| 545 | 545 | // if the storage isn't in the cache yet, just scan the root completely |
| 546 | - $this->runBackgroundScanJob(function () { |
|
| 546 | + $this->runBackgroundScanJob(function() { |
|
| 547 | 547 | $this->scan('', self::SCAN_RECURSIVE, self::REUSE_ETAG); |
| 548 | 548 | }, ''); |
| 549 | 549 | } else { |
| 550 | 550 | $lastPath = null; |
| 551 | 551 | // find any path marked as unscanned and run the scanner until no more paths are unscanned (or we get stuck) |
| 552 | 552 | while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) { |
| 553 | - $this->runBackgroundScanJob(function () use ($path) { |
|
| 553 | + $this->runBackgroundScanJob(function() use ($path) { |
|
| 554 | 554 | $this->scan($path, self::SCAN_RECURSIVE_INCOMPLETE, self::REUSE_ETAG | self::REUSE_SIZE); |
| 555 | 555 | }, $path); |
| 556 | 556 | // FIXME: this won't proceed with the next item, needs revamping of getIncomplete() |