@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | throw new \Exception('missing IObjectStore instance'); |
| 58 | 58 | } |
| 59 | 59 | if (isset($params['storageid'])) { |
| 60 | - $this->id = 'object::store:' . $params['storageid']; |
|
| 60 | + $this->id = 'object::store:'.$params['storageid']; |
|
| 61 | 61 | } else { |
| 62 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
| 62 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
| 63 | 63 | } |
| 64 | 64 | if (isset($params['objectPrefix'])) { |
| 65 | 65 | $this->objectPrefix = $params['objectPrefix']; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if ($ex->getCode() !== 404) { |
| 194 | 194 | $this->logger->logException($ex, [ |
| 195 | 195 | 'app' => 'objectstore', |
| 196 | - 'message' => 'Could not delete object ' . $this->getURN($stat['fileid']) . ' for ' . $path, |
|
| 196 | + 'message' => 'Could not delete object '.$this->getURN($stat['fileid']).' for '.$path, |
|
| 197 | 197 | ]); |
| 198 | 198 | return false; |
| 199 | 199 | } else { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | protected function getURN($fileId) { |
| 228 | 228 | if (is_numeric($fileId)) { |
| 229 | - return $this->objectPrefix . $fileId; |
|
| 229 | + return $this->objectPrefix.$fileId; |
|
| 230 | 230 | } |
| 231 | 231 | return null; |
| 232 | 232 | } |
@@ -274,13 +274,13 @@ discard block |
||
| 274 | 274 | } catch (NotFoundException $e) { |
| 275 | 275 | $this->logger->logException($e, [ |
| 276 | 276 | 'app' => 'objectstore', |
| 277 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 277 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 278 | 278 | ]); |
| 279 | 279 | throw $e; |
| 280 | 280 | } catch (\Exception $ex) { |
| 281 | 281 | $this->logger->logException($ex, [ |
| 282 | 282 | 'app' => 'objectstore', |
| 283 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 283 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 284 | 284 | ]); |
| 285 | 285 | return false; |
| 286 | 286 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | file_put_contents($tmpFile, $source); |
| 311 | 311 | } |
| 312 | 312 | $handle = fopen($tmpFile, $mode); |
| 313 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 313 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 314 | 314 | $this->writeBack($tmpFile, $path); |
| 315 | 315 | }); |
| 316 | 316 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | public function file_exists($path) { |
| 321 | 321 | $path = $this->normalizePath($path); |
| 322 | - return (bool)$this->stat($path); |
|
| 322 | + return (bool) $this->stat($path); |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | public function rename($source, $target) { |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } catch (\Exception $ex) { |
| 377 | 377 | $this->logger->logException($ex, [ |
| 378 | 378 | 'app' => 'objectstore', |
| 379 | - 'message' => 'Could not create object for ' . $path, |
|
| 379 | + 'message' => 'Could not create object for '.$path, |
|
| 380 | 380 | ]); |
| 381 | 381 | return false; |
| 382 | 382 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $this->getCache()->remove($path); |
| 417 | 417 | $this->logger->logException($ex, [ |
| 418 | 418 | 'app' => 'objectstore', |
| 419 | - 'message' => 'Could not create object ' . $this->getURN($fileId) . ' for ' . $path, |
|
| 419 | + 'message' => 'Could not create object '.$this->getURN($fileId).' for '.$path, |
|
| 420 | 420 | ]); |
| 421 | 421 | throw $ex; // make this bubble up |
| 422 | 422 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | throw new Forbidden(); |
| 122 | 122 | } |
| 123 | 123 | } catch (StorageNotAvailableException $e) { |
| 124 | - throw new ServiceUnavailable("File is not updatable: " . $e->getMessage()); |
|
| 124 | + throw new ServiceUnavailable("File is not updatable: ".$e->getMessage()); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // verify path of the target |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | if ($needsPartFile) { |
| 145 | 145 | // mark file as partial while uploading (ignored by the scanner) |
| 146 | - $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; |
|
| 146 | + $partFilePath = $this->getPartFileBasePath($this->path).'.ocTransferId'.rand().'.part'; |
|
| 147 | 147 | } else { |
| 148 | 148 | // upload file directly as the final path |
| 149 | 149 | $partFilePath = $this->path; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | if (isset($_SERVER['CONTENT_LENGTH'])) { |
| 178 | 178 | $expected = $_SERVER['CONTENT_LENGTH']; |
| 179 | 179 | } |
| 180 | - throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )'); |
|
| 180 | + throw new Exception('Error while copying file to target location (copied bytes: '.$count.', expected filesize: '.$expected.' )'); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // if content length is sent by client: |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
| 187 | 187 | $expected = (int) $_SERVER['CONTENT_LENGTH']; |
| 188 | 188 | if ($count !== $expected) { |
| 189 | - throw new BadRequest('expected filesize ' . $expected . ' got ' . $count); |
|
| 189 | + throw new BadRequest('expected filesize '.$expected.' got '.$count); |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $renameOkay = $storage->moveFromStorage($partStorage, $internalPartPath, $internalPath); |
| 218 | 218 | $fileExists = $storage->file_exists($internalPath); |
| 219 | 219 | if ($renameOkay === false || $fileExists === false) { |
| 220 | - \OC::$server->getLogger()->error('renaming part file to final file failed ($run: ' . ( $run ? 'true' : 'false' ) . ', $renameOkay: ' . ( $renameOkay ? 'true' : 'false' ) . ', $fileExists: ' . ( $fileExists ? 'true' : 'false' ) . ')', ['app' => 'webdav']); |
|
| 220 | + \OC::$server->getLogger()->error('renaming part file to final file failed ($run: '.($run ? 'true' : 'false').', $renameOkay: '.($renameOkay ? 'true' : 'false').', $fileExists: '.($fileExists ? 'true' : 'false').')', ['app' => 'webdav']); |
|
| 221 | 221 | throw new Exception('Could not rename part file to final file'); |
| 222 | 222 | } |
| 223 | 223 | } catch (ForbiddenException $ex) { |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | } catch (StorageNotAvailableException $e) { |
| 264 | - throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage()); |
|
| 264 | + throw new ServiceUnavailable("Failed to check file size: ".$e->getMessage()); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - return '"' . $this->info->getEtag() . '"'; |
|
| 267 | + return '"'.$this->info->getEtag().'"'; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | private function getPartFileBasePath($path) { |
@@ -347,15 +347,15 @@ discard block |
||
| 347 | 347 | return $res; |
| 348 | 348 | } catch (GenericEncryptionException $e) { |
| 349 | 349 | // returning 503 will allow retry of the operation at a later point in time |
| 350 | - throw new ServiceUnavailable("Encryption not ready: " . $e->getMessage()); |
|
| 350 | + throw new ServiceUnavailable("Encryption not ready: ".$e->getMessage()); |
|
| 351 | 351 | } catch (StorageNotAvailableException $e) { |
| 352 | - throw new ServiceUnavailable("Failed to open file: " . $e->getMessage()); |
|
| 352 | + throw new ServiceUnavailable("Failed to open file: ".$e->getMessage()); |
|
| 353 | 353 | } catch (ForbiddenException $ex) { |
| 354 | 354 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
| 355 | 355 | } catch (LockedException $e) { |
| 356 | 356 | throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
| 357 | 357 | } catch (NotFoundException $e) { |
| 358 | - throw new NotFound('File not found: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 358 | + throw new NotFound('File not found: '.$e->getMessage(), $e->getCode(), $e); |
|
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | throw new Forbidden(); |
| 377 | 377 | } |
| 378 | 378 | } catch (StorageNotAvailableException $e) { |
| 379 | - throw new ServiceUnavailable("Failed to unlink: " . $e->getMessage()); |
|
| 379 | + throw new ServiceUnavailable("Failed to unlink: ".$e->getMessage()); |
|
| 380 | 380 | } catch (ForbiddenException $ex) { |
| 381 | 381 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
| 382 | 382 | } catch (LockedException $e) { |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | if ($bytesWritten !== $expected) { |
| 444 | 444 | $chunk_handler->remove($info['index']); |
| 445 | 445 | throw new BadRequest( |
| 446 | - 'expected filesize ' . $expected . ' got ' . $bytesWritten); |
|
| 446 | + 'expected filesize '.$expected.' got '.$bytesWritten); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $needsPartFile = $this->needsPartFile($storage); |
| 454 | 454 | $partFile = null; |
| 455 | 455 | |
| 456 | - $targetPath = $path . '/' . $info['name']; |
|
| 456 | + $targetPath = $path.'/'.$info['name']; |
|
| 457 | 457 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
| 458 | 458 | list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); |
| 459 | 459 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | if ($needsPartFile) { |
| 471 | 471 | // we first assembly the target file as a part file |
| 472 | - $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; |
|
| 472 | + $partFile = $this->getPartFileBasePath($path.'/'.$info['name']).'.ocTransferId'.$info['transferid'].'.part'; |
|
| 473 | 473 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
| 474 | 474 | list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); |
| 475 | 475 | |
@@ -588,10 +588,10 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | if ($e instanceof GenericEncryptionException) { |
| 590 | 590 | // returning 503 will allow retry of the operation at a later point in time |
| 591 | - throw new ServiceUnavailable('Encryption not ready: ' . $e->getMessage(), 0, $e); |
|
| 591 | + throw new ServiceUnavailable('Encryption not ready: '.$e->getMessage(), 0, $e); |
|
| 592 | 592 | } |
| 593 | 593 | if ($e instanceof StorageNotAvailableException) { |
| 594 | - throw new ServiceUnavailable('Failed to write file contents: ' . $e->getMessage(), 0, $e); |
|
| 594 | + throw new ServiceUnavailable('Failed to write file contents: '.$e->getMessage(), 0, $e); |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); |