@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | throw new Forbidden(); |
124 | 124 | } |
125 | 125 | } catch (StorageNotAvailableException $e) { |
126 | - throw new ServiceUnavailable("File is not updatable: " . $e->getMessage()); |
|
126 | + throw new ServiceUnavailable("File is not updatable: ".$e->getMessage()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // verify path of the target |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | if ($needsPartFile) { |
148 | 148 | // mark file as partial while uploading (ignored by the scanner) |
149 | - $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; |
|
149 | + $partFilePath = $this->getPartFileBasePath($this->path).'.ocTransferId'.rand().'.part'; |
|
150 | 150 | |
151 | 151 | if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { |
152 | 152 | $needsPartFile = false; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | $isEOF = false; |
186 | - $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF) { |
|
186 | + $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF) { |
|
187 | 187 | $isEOF = feof($stream); |
188 | 188 | }); |
189 | 189 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $expected = $_SERVER['CONTENT_LENGTH']; |
215 | 215 | } |
216 | 216 | if ($expected !== "0") { |
217 | - throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )'); |
|
217 | + throw new Exception('Error while copying file to target location (copied bytes: '.$count.', expected filesize: '.$expected.' )'); |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | // double check if the file was fully received |
223 | 223 | // compare expected and actual size |
224 | 224 | if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
225 | - $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
225 | + $expected = (int) $_SERVER['CONTENT_LENGTH']; |
|
226 | 226 | if ($count !== $expected) { |
227 | - throw new BadRequest('expected filesize ' . $expected . ' got ' . $count); |
|
227 | + throw new BadRequest('expected filesize '.$expected.' got '.$count); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $renameOkay = $storage->moveFromStorage($partStorage, $internalPartPath, $internalPath); |
257 | 257 | $fileExists = $storage->file_exists($internalPath); |
258 | 258 | if ($renameOkay === false || $fileExists === false) { |
259 | - \OC::$server->getLogger()->error('renaming part file to final file failed $renameOkay: ' . ($renameOkay ? 'true' : 'false') . ', $fileExists: ' . ($fileExists ? 'true' : 'false') . ')', ['app' => 'webdav']); |
|
259 | + \OC::$server->getLogger()->error('renaming part file to final file failed $renameOkay: '.($renameOkay ? 'true' : 'false').', $fileExists: '.($fileExists ? 'true' : 'false').')', ['app' => 'webdav']); |
|
260 | 260 | throw new Exception('Could not rename part file to final file'); |
261 | 261 | } |
262 | 262 | } catch (ForbiddenException $ex) { |
@@ -300,10 +300,10 @@ discard block |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | } catch (StorageNotAvailableException $e) { |
303 | - throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage(), 0, $e); |
|
303 | + throw new ServiceUnavailable("Failed to check file size: ".$e->getMessage(), 0, $e); |
|
304 | 304 | } |
305 | 305 | |
306 | - return '"' . $this->info->getEtag() . '"'; |
|
306 | + return '"'.$this->info->getEtag().'"'; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | private function getPartFileBasePath($path) { |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | return $res; |
391 | 391 | } catch (GenericEncryptionException $e) { |
392 | 392 | // returning 503 will allow retry of the operation at a later point in time |
393 | - throw new ServiceUnavailable("Encryption not ready: " . $e->getMessage()); |
|
393 | + throw new ServiceUnavailable("Encryption not ready: ".$e->getMessage()); |
|
394 | 394 | } catch (StorageNotAvailableException $e) { |
395 | - throw new ServiceUnavailable("Failed to open file: " . $e->getMessage()); |
|
395 | + throw new ServiceUnavailable("Failed to open file: ".$e->getMessage()); |
|
396 | 396 | } catch (ForbiddenException $ex) { |
397 | 397 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
398 | 398 | } catch (LockedException $e) { |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | throw new Forbidden(); |
418 | 418 | } |
419 | 419 | } catch (StorageNotAvailableException $e) { |
420 | - throw new ServiceUnavailable("Failed to unlink: " . $e->getMessage()); |
|
420 | + throw new ServiceUnavailable("Failed to unlink: ".$e->getMessage()); |
|
421 | 421 | } catch (ForbiddenException $ex) { |
422 | 422 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
423 | 423 | } catch (LockedException $e) { |
@@ -480,11 +480,11 @@ discard block |
||
480 | 480 | //detect aborted upload |
481 | 481 | if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
482 | 482 | if (isset($_SERVER['CONTENT_LENGTH'])) { |
483 | - $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
483 | + $expected = (int) $_SERVER['CONTENT_LENGTH']; |
|
484 | 484 | if ($bytesWritten !== $expected) { |
485 | 485 | $chunk_handler->remove($info['index']); |
486 | 486 | throw new BadRequest( |
487 | - 'expected filesize ' . $expected . ' got ' . $bytesWritten); |
|
487 | + 'expected filesize '.$expected.' got '.$bytesWritten); |
|
488 | 488 | } |
489 | 489 | } |
490 | 490 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $needsPartFile = $storage->needsPartFile(); |
496 | 496 | $partFile = null; |
497 | 497 | |
498 | - $targetPath = $path . '/' . $info['name']; |
|
498 | + $targetPath = $path.'/'.$info['name']; |
|
499 | 499 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
500 | 500 | list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); |
501 | 501 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | |
512 | 512 | if ($needsPartFile) { |
513 | 513 | // we first assembly the target file as a part file |
514 | - $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; |
|
514 | + $partFile = $this->getPartFileBasePath($path.'/'.$info['name']).'.ocTransferId'.$info['transferid'].'.part'; |
|
515 | 515 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
516 | 516 | list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); |
517 | 517 | |
@@ -615,13 +615,13 @@ discard block |
||
615 | 615 | } |
616 | 616 | if ($e instanceof GenericEncryptionException) { |
617 | 617 | // returning 503 will allow retry of the operation at a later point in time |
618 | - throw new ServiceUnavailable('Encryption not ready: ' . $e->getMessage(), 0, $e); |
|
618 | + throw new ServiceUnavailable('Encryption not ready: '.$e->getMessage(), 0, $e); |
|
619 | 619 | } |
620 | 620 | if ($e instanceof StorageNotAvailableException) { |
621 | - throw new ServiceUnavailable('Failed to write file contents: ' . $e->getMessage(), 0, $e); |
|
621 | + throw new ServiceUnavailable('Failed to write file contents: '.$e->getMessage(), 0, $e); |
|
622 | 622 | } |
623 | 623 | if ($e instanceof NotFoundException) { |
624 | - throw new NotFound('File not found: ' . $e->getMessage(), 0, $e); |
|
624 | + throw new NotFound('File not found: '.$e->getMessage(), 0, $e); |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); |