@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | throw new \Exception('missing IObjectStore instance'); |
72 | 72 | } |
73 | 73 | if (isset($params['storageid'])) { |
74 | - $this->id = 'object::store:' . $params['storageid']; |
|
74 | + $this->id = 'object::store:'.$params['storageid']; |
|
75 | 75 | } else { |
76 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
76 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
77 | 77 | } |
78 | 78 | if (isset($params['objectPrefix'])) { |
79 | 79 | $this->objectPrefix = $params['objectPrefix']; |
80 | 80 | } |
81 | 81 | if (isset($params['validateWrites'])) { |
82 | - $this->validateWrites = (bool)$params['validateWrites']; |
|
82 | + $this->validateWrites = (bool) $params['validateWrites']; |
|
83 | 83 | } |
84 | 84 | //initialize cache with root directory in cache |
85 | 85 | if (!$this->is_dir('/')) { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | if ($ex->getCode() !== 404) { |
219 | 219 | $this->logger->logException($ex, [ |
220 | 220 | 'app' => 'objectstore', |
221 | - 'message' => 'Could not delete object ' . $this->getURN($stat['fileid']) . ' for ' . $path, |
|
221 | + 'message' => 'Could not delete object '.$this->getURN($stat['fileid']).' for '.$path, |
|
222 | 222 | ]); |
223 | 223 | return false; |
224 | 224 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function getURN($fileId) { |
262 | 262 | if (is_numeric($fileId)) { |
263 | - return $this->objectPrefix . $fileId; |
|
263 | + return $this->objectPrefix.$fileId; |
|
264 | 264 | } |
265 | 265 | return null; |
266 | 266 | } |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | } catch (NotFoundException $e) { |
320 | 320 | $this->logger->logException($e, [ |
321 | 321 | 'app' => 'objectstore', |
322 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
322 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
323 | 323 | ]); |
324 | 324 | throw $e; |
325 | 325 | } catch (\Exception $ex) { |
326 | 326 | $this->logger->logException($ex, [ |
327 | 327 | 'app' => 'objectstore', |
328 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
328 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
329 | 329 | ]); |
330 | 330 | return false; |
331 | 331 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | case 'wb+': |
340 | 340 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext); |
341 | 341 | $handle = fopen($tmpFile, $mode); |
342 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
342 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
343 | 343 | $this->writeBack($tmpFile, $path); |
344 | 344 | unlink($tmpFile); |
345 | 345 | }); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | file_put_contents($tmpFile, $source); |
358 | 358 | } |
359 | 359 | $handle = fopen($tmpFile, $mode); |
360 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
360 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
361 | 361 | $this->writeBack($tmpFile, $path); |
362 | 362 | unlink($tmpFile); |
363 | 363 | }); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | |
368 | 368 | public function file_exists($path) { |
369 | 369 | $path = $this->normalizePath($path); |
370 | - return (bool)$this->stat($path); |
|
370 | + return (bool) $this->stat($path); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | public function rename($source, $target) { |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } catch (\Exception $ex) { |
420 | 420 | $this->logger->logException($ex, [ |
421 | 421 | 'app' => 'objectstore', |
422 | - 'message' => 'Could not create object for ' . $path, |
|
422 | + 'message' => 'Could not create object for '.$path, |
|
423 | 423 | ]); |
424 | 424 | throw $ex; |
425 | 425 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | } |
465 | 465 | // update stat with new data |
466 | 466 | $mTime = time(); |
467 | - $stat['size'] = (int)$size; |
|
467 | + $stat['size'] = (int) $size; |
|
468 | 468 | $stat['mtime'] = $mTime; |
469 | 469 | $stat['storage_mtime'] = $mTime; |
470 | 470 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $stat['checksum'] = ''; |
477 | 477 | |
478 | 478 | $exists = $this->getCache()->inCache($path); |
479 | - $uploadPath = $exists ? $path : $path . '.part'; |
|
479 | + $uploadPath = $exists ? $path : $path.'.part'; |
|
480 | 480 | |
481 | 481 | if ($exists) { |
482 | 482 | $fileId = $stat['fileid']; |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | try { |
489 | 489 | //upload to object storage |
490 | 490 | if ($size === null) { |
491 | - $countStream = CountWrapper::wrap($stream, function ($writtenSize) use ($fileId, &$size) { |
|
491 | + $countStream = CountWrapper::wrap($stream, function($writtenSize) use ($fileId, &$size) { |
|
492 | 492 | $this->getCache()->update($fileId, [ |
493 | 493 | 'size' => $writtenSize, |
494 | 494 | ]); |
@@ -514,12 +514,12 @@ discard block |
||
514 | 514 | $this->getCache()->remove($uploadPath); |
515 | 515 | $this->logger->logException($ex, [ |
516 | 516 | 'app' => 'objectstore', |
517 | - 'message' => 'Could not create object ' . $urn . ' for ' . $path, |
|
517 | + 'message' => 'Could not create object '.$urn.' for '.$path, |
|
518 | 518 | ]); |
519 | 519 | } else { |
520 | 520 | $this->logger->logException($ex, [ |
521 | 521 | 'app' => 'objectstore', |
522 | - 'message' => 'Could not update object ' . $urn . ' for ' . $path, |
|
522 | + 'message' => 'Could not update object '.$urn.' for '.$path, |
|
523 | 523 | ]); |
524 | 524 | } |
525 | 525 | throw $ex; // make this bubble up |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $this->mkdir($to); |
590 | 590 | |
591 | 591 | foreach ($cache->getFolderContentsById($sourceEntry->getId()) as $child) { |
592 | - $this->copyInner($child, $to . '/' . $child->getName()); |
|
592 | + $this->copyInner($child, $to.'/'.$child->getName()); |
|
593 | 593 | } |
594 | 594 | } else { |
595 | 595 | $this->copyFile($sourceEntry, $to); |