@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | throw new \Exception('missing IObjectStore instance'); |
| 79 | 79 | } |
| 80 | 80 | if (isset($params['storageid'])) { |
| 81 | - $this->id = 'object::store:' . $params['storageid']; |
|
| 81 | + $this->id = 'object::store:'.$params['storageid']; |
|
| 82 | 82 | } else { |
| 83 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
| 83 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
| 84 | 84 | } |
| 85 | 85 | if (isset($params['objectPrefix'])) { |
| 86 | 86 | $this->objectPrefix = $params['objectPrefix']; |
| 87 | 87 | } |
| 88 | 88 | if (isset($params['validateWrites'])) { |
| 89 | - $this->validateWrites = (bool)$params['validateWrites']; |
|
| 89 | + $this->validateWrites = (bool) $params['validateWrites']; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $this->logger = \OC::$server->getLogger(); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | if ($ex->getCode() !== 404) { |
| 228 | 228 | $this->logger->logException($ex, [ |
| 229 | 229 | 'app' => 'objectstore', |
| 230 | - 'message' => 'Could not delete object ' . $this->getURN($entry->getId()) . ' for ' . $entry->getPath(), |
|
| 230 | + 'message' => 'Could not delete object '.$this->getURN($entry->getId()).' for '.$entry->getPath(), |
|
| 231 | 231 | ]); |
| 232 | 232 | return false; |
| 233 | 233 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | public function getURN($fileId) { |
| 276 | 276 | if (is_numeric($fileId)) { |
| 277 | - return $this->objectPrefix . $fileId; |
|
| 277 | + return $this->objectPrefix.$fileId; |
|
| 278 | 278 | } |
| 279 | 279 | return null; |
| 280 | 280 | } |
@@ -337,19 +337,19 @@ discard block |
||
| 337 | 337 | $streamStat = fstat($handle); |
| 338 | 338 | $actualSize = $streamStat['size'] ?? -1; |
| 339 | 339 | if ($actualSize > -1 && $actualSize !== $filesize) { |
| 340 | - $this->getCache()->update((int)$stat['fileid'], ['size' => $actualSize]); |
|
| 340 | + $this->getCache()->update((int) $stat['fileid'], ['size' => $actualSize]); |
|
| 341 | 341 | } |
| 342 | 342 | return $handle; |
| 343 | 343 | } catch (NotFoundException $e) { |
| 344 | 344 | $this->logger->logException($e, [ |
| 345 | 345 | 'app' => 'objectstore', |
| 346 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 346 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 347 | 347 | ]); |
| 348 | 348 | throw $e; |
| 349 | 349 | } catch (\Exception $ex) { |
| 350 | 350 | $this->logger->logException($ex, [ |
| 351 | 351 | 'app' => 'objectstore', |
| 352 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 352 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 353 | 353 | ]); |
| 354 | 354 | return false; |
| 355 | 355 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext); |
| 371 | 371 | $handle = fopen($tmpFile, $mode); |
| 372 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 372 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 373 | 373 | $this->writeBack($tmpFile, $path); |
| 374 | 374 | unlink($tmpFile); |
| 375 | 375 | }); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | file_put_contents($tmpFile, $source); |
| 388 | 388 | } |
| 389 | 389 | $handle = fopen($tmpFile, $mode); |
| 390 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 390 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 391 | 391 | $this->writeBack($tmpFile, $path); |
| 392 | 392 | unlink($tmpFile); |
| 393 | 393 | }); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | public function file_exists($path) { |
| 399 | 399 | $path = $this->normalizePath($path); |
| 400 | - return (bool)$this->stat($path); |
|
| 400 | + return (bool) $this->stat($path); |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | public function rename($source, $target) { |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } catch (\Exception $ex) { |
| 450 | 450 | $this->logger->logException($ex, [ |
| 451 | 451 | 'app' => 'objectstore', |
| 452 | - 'message' => 'Could not create object for ' . $path, |
|
| 452 | + 'message' => 'Could not create object for '.$path, |
|
| 453 | 453 | ]); |
| 454 | 454 | throw $ex; |
| 455 | 455 | } |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | } |
| 498 | 498 | // update stat with new data |
| 499 | 499 | $mTime = time(); |
| 500 | - $stat['size'] = (int)$size; |
|
| 500 | + $stat['size'] = (int) $size; |
|
| 501 | 501 | $stat['mtime'] = $mTime; |
| 502 | 502 | $stat['storage_mtime'] = $mTime; |
| 503 | 503 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $stat['checksum'] = ''; |
| 510 | 510 | |
| 511 | 511 | $exists = $this->getCache()->inCache($path); |
| 512 | - $uploadPath = $exists ? $path : $path . '.part'; |
|
| 512 | + $uploadPath = $exists ? $path : $path.'.part'; |
|
| 513 | 513 | |
| 514 | 514 | if ($exists) { |
| 515 | 515 | $fileId = $stat['fileid']; |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | try { |
| 522 | 522 | //upload to object storage |
| 523 | 523 | if ($size === null) { |
| 524 | - $countStream = CountWrapper::wrap($stream, function ($writtenSize) use ($fileId, &$size) { |
|
| 524 | + $countStream = CountWrapper::wrap($stream, function($writtenSize) use ($fileId, &$size) { |
|
| 525 | 525 | $this->getCache()->update($fileId, [ |
| 526 | 526 | 'size' => $writtenSize, |
| 527 | 527 | ]); |
@@ -547,12 +547,12 @@ discard block |
||
| 547 | 547 | $this->getCache()->remove($uploadPath); |
| 548 | 548 | $this->logger->logException($ex, [ |
| 549 | 549 | 'app' => 'objectstore', |
| 550 | - 'message' => 'Could not create object ' . $urn . ' for ' . $path, |
|
| 550 | + 'message' => 'Could not create object '.$urn.' for '.$path, |
|
| 551 | 551 | ]); |
| 552 | 552 | } else { |
| 553 | 553 | $this->logger->logException($ex, [ |
| 554 | 554 | 'app' => 'objectstore', |
| 555 | - 'message' => 'Could not update object ' . $urn . ' for ' . $path, |
|
| 555 | + 'message' => 'Could not update object '.$urn.' for '.$path, |
|
| 556 | 556 | ]); |
| 557 | 557 | } |
| 558 | 558 | throw $ex; // make this bubble up |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | $this->mkdir($to); |
| 628 | 628 | |
| 629 | 629 | foreach ($sourceCache->getFolderContentsById($sourceEntry->getId()) as $child) { |
| 630 | - $this->copyInner($sourceCache, $child, $to . '/' . $child->getName()); |
|
| 630 | + $this->copyInner($sourceCache, $child, $to.'/'.$child->getName()); |
|
| 631 | 631 | } |
| 632 | 632 | } else { |
| 633 | 633 | $this->copyFile($sourceEntry, $to); |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $cacheEntry = $this->getCache()->get($targetPath); |
| 683 | 683 | $urn = $this->getURN($cacheEntry->getId()); |
| 684 | 684 | |
| 685 | - $result = $this->objectStore->uploadMultipartPart($urn, $writeToken, (int)$chunkId, $data, $size); |
|
| 685 | + $result = $this->objectStore->uploadMultipartPart($urn, $writeToken, (int) $chunkId, $data, $size); |
|
| 686 | 686 | |
| 687 | 687 | $parts[$chunkId] = [ |
| 688 | 688 | 'PartNumber' => $chunkId, |
@@ -710,11 +710,11 @@ discard block |
||
| 710 | 710 | $stat['mimetype'] = $this->getMimeType($targetPath); |
| 711 | 711 | $this->getCache()->update($stat['fileid'], $stat); |
| 712 | 712 | } |
| 713 | - } catch (S3MultipartUploadException|S3Exception $e) { |
|
| 713 | + } catch (S3MultipartUploadException | S3Exception $e) { |
|
| 714 | 714 | $this->objectStore->abortMultipartUpload($urn, $writeToken); |
| 715 | 715 | $this->logger->logException($e, [ |
| 716 | 716 | 'app' => 'objectstore', |
| 717 | - 'message' => 'Could not compete multipart upload ' . $urn . ' with uploadId ' . $writeToken, |
|
| 717 | + 'message' => 'Could not compete multipart upload '.$urn.' with uploadId '.$writeToken, |
|
| 718 | 718 | ]); |
| 719 | 719 | throw new GenericFileException('Could not write chunked file'); |
| 720 | 720 | } |