@@ -66,7 +66,7 @@ |
||
66 | 66 | function xmlSerialize(Writer $writer) { |
67 | 67 | |
68 | 68 | foreach ($this->checksums as $checksum) { |
69 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
69 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}checksum', $checksum); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // exit if we can't create a new file and we don't updatable existing file |
116 | 116 | $info = \OC_FileChunking::decodeName($name); |
117 | 117 | if (!$this->fileView->isCreatable($this->path) && |
118 | - !$this->fileView->isUpdatable($this->path . '/' . $info['name']) |
|
118 | + !$this->fileView->isUpdatable($this->path.'/'.$info['name']) |
|
119 | 119 | ) { |
120 | 120 | throw new \Sabre\DAV\Exception\Forbidden(); |
121 | 121 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $this->fileView->verifyPath($this->path, $name); |
131 | 131 | |
132 | - $path = $this->fileView->getAbsolutePath($this->path) . '/' . $name; |
|
132 | + $path = $this->fileView->getAbsolutePath($this->path).'/'.$name; |
|
133 | 133 | // using a dummy FileInfo is acceptable here since it will be refreshed after the put is complete |
134 | 134 | $info = new \OC\Files\FileInfo($path, null, null, array(), null); |
135 | 135 | $node = new \OCA\DAV\Connector\Sabre\File($this->fileView, $info); |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | $this->fileView->verifyPath($this->path, $name); |
165 | - $newPath = $this->path . '/' . $name; |
|
165 | + $newPath = $this->path.'/'.$name; |
|
166 | 166 | if (!$this->fileView->mkdir($newPath)) { |
167 | - throw new \Sabre\DAV\Exception\Forbidden('Could not create directory ' . $newPath); |
|
167 | + throw new \Sabre\DAV\Exception\Forbidden('Could not create directory '.$newPath); |
|
168 | 168 | } |
169 | 169 | } catch (\OCP\Files\StorageNotAvailableException $e) { |
170 | 170 | throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * @throws \Sabre\DAV\Exception\ServiceUnavailable |
189 | 189 | */ |
190 | 190 | public function getChild($name, $info = null) { |
191 | - $path = $this->path . '/' . $name; |
|
191 | + $path = $this->path.'/'.$name; |
|
192 | 192 | if (is_null($info)) { |
193 | 193 | try { |
194 | 194 | $this->fileView->verifyPath($this->path, $name); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | if (!$info) { |
206 | - throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located'); |
|
206 | + throw new \Sabre\DAV\Exception\NotFound('File with name '.$path.' could not be located'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | if ($info['mimetype'] == 'httpd/unix-directory') { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | // (required old code) instead of "updateFile". |
256 | 256 | // |
257 | 257 | // TODO: resolve chunk file name here and implement "updateFile" |
258 | - $path = $this->path . '/' . $name; |
|
258 | + $path = $this->path.'/'.$name; |
|
259 | 259 | return $this->fileView->file_exists($path); |
260 | 260 | |
261 | 261 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function beforeHandler(RequestInterface $request) { |
66 | 66 | $userAgent = $request->getHeader('User-Agent'); |
67 | - if($userAgent === null) { |
|
67 | + if ($userAgent === null) { |
|
68 | 68 | return; |
69 | 69 | } |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | // Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or |
74 | 74 | // "mirall/%1" for older releases |
75 | 75 | preg_match("/(?:mirall\\/)([\d.]+)/i", $userAgent, $versionMatches); |
76 | - if(isset($versionMatches[1]) && |
|
76 | + if (isset($versionMatches[1]) && |
|
77 | 77 | version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) { |
78 | 78 | throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.'); |
79 | 79 | } |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | * @return mixed|string |
100 | 100 | */ |
101 | 101 | public function getCommentsLink(Node $node) { |
102 | - $href = $this->server->getBaseUri(); |
|
102 | + $href = $this->server->getBaseUri(); |
|
103 | 103 | $entryPoint = strpos($href, '/remote.php/'); |
104 | - if($entryPoint === false) { |
|
104 | + if ($entryPoint === false) { |
|
105 | 105 | // in case we end up somewhere else, unexpectedly. |
106 | 106 | return null; |
107 | 107 | } |
108 | - $commentsPart = 'dav/comments/files/' . rawurldecode($node->getId()); |
|
108 | + $commentsPart = 'dav/comments/files/'.rawurldecode($node->getId()); |
|
109 | 109 | $href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/')); |
110 | 110 | return $href; |
111 | 111 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getUnreadCount(Node $node) { |
121 | 121 | $user = $this->userSession->getUser(); |
122 | - if(is_null($user)) { |
|
122 | + if (is_null($user)) { |
|
123 | 123 | return null; |
124 | 124 | } |
125 | 125 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | throw new Forbidden(); |
93 | 93 | } |
94 | 94 | } catch (StorageNotAvailableException $e) { |
95 | - throw new ServiceUnavailable("File is not updatable: " . $e->getMessage()); |
|
95 | + throw new ServiceUnavailable("File is not updatable: ".$e->getMessage()); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | // verify path of the target |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | if ($needsPartFile) { |
114 | 114 | // mark file as partial while uploading (ignored by the scanner) |
115 | - $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; |
|
115 | + $partFilePath = $this->getPartFileBasePath($this->path).'.ocTransferId'.rand().'.part'; |
|
116 | 116 | } else { |
117 | 117 | // upload file directly as the final path |
118 | 118 | $partFilePath = $this->path; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if (isset($_SERVER['CONTENT_LENGTH'])) { |
139 | 139 | $expected = $_SERVER['CONTENT_LENGTH']; |
140 | 140 | } |
141 | - throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )'); |
|
141 | + throw new Exception('Error while copying file to target location (copied bytes: '.$count.', expected filesize: '.$expected.' )'); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | // if content length is sent by client: |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
148 | 148 | $expected = $_SERVER['CONTENT_LENGTH']; |
149 | 149 | if ($count != $expected) { |
150 | - throw new BadRequest('expected filesize ' . $expected . ' got ' . $count); |
|
150 | + throw new BadRequest('expected filesize '.$expected.' got '.$count); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | } catch (StorageNotAvailableException $e) { |
230 | - throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage()); |
|
230 | + throw new ServiceUnavailable("Failed to check file size: ".$e->getMessage()); |
|
231 | 231 | } |
232 | 232 | |
233 | - return '"' . $this->info->getEtag() . '"'; |
|
233 | + return '"'.$this->info->getEtag().'"'; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | private function getPartFileBasePath($path) { |
@@ -309,9 +309,9 @@ discard block |
||
309 | 309 | return $res; |
310 | 310 | } catch (GenericEncryptionException $e) { |
311 | 311 | // returning 503 will allow retry of the operation at a later point in time |
312 | - throw new ServiceUnavailable("Encryption not ready: " . $e->getMessage()); |
|
312 | + throw new ServiceUnavailable("Encryption not ready: ".$e->getMessage()); |
|
313 | 313 | } catch (StorageNotAvailableException $e) { |
314 | - throw new ServiceUnavailable("Failed to open file: " . $e->getMessage()); |
|
314 | + throw new ServiceUnavailable("Failed to open file: ".$e->getMessage()); |
|
315 | 315 | } catch (ForbiddenException $ex) { |
316 | 316 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
317 | 317 | } catch (LockedException $e) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | throw new Forbidden(); |
337 | 337 | } |
338 | 338 | } catch (StorageNotAvailableException $e) { |
339 | - throw new ServiceUnavailable("Failed to unlink: " . $e->getMessage()); |
|
339 | + throw new ServiceUnavailable("Failed to unlink: ".$e->getMessage()); |
|
340 | 340 | } catch (ForbiddenException $ex) { |
341 | 341 | throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
342 | 342 | } catch (LockedException $e) { |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | if ($bytesWritten != $expected) { |
404 | 404 | $chunk_handler->remove($info['index']); |
405 | 405 | throw new BadRequest( |
406 | - 'expected filesize ' . $expected . ' got ' . $bytesWritten); |
|
406 | + 'expected filesize '.$expected.' got '.$bytesWritten); |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | } |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $needsPartFile = $this->needsPartFile($storage); |
414 | 414 | $partFile = null; |
415 | 415 | |
416 | - $targetPath = $path . '/' . $info['name']; |
|
416 | + $targetPath = $path.'/'.$info['name']; |
|
417 | 417 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
418 | 418 | list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); |
419 | 419 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | if ($needsPartFile) { |
431 | 431 | // we first assembly the target file as a part file |
432 | - $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; |
|
432 | + $partFile = $this->getPartFileBasePath($path.'/'.$info['name']).'.ocTransferId'.$info['transferid'].'.part'; |
|
433 | 433 | /** @var \OC\Files\Storage\Storage $targetStorage */ |
434 | 434 | list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); |
435 | 435 | |
@@ -548,10 +548,10 @@ discard block |
||
548 | 548 | } |
549 | 549 | if ($e instanceof GenericEncryptionException) { |
550 | 550 | // returning 503 will allow retry of the operation at a later point in time |
551 | - throw new ServiceUnavailable('Encryption not ready: ' . $e->getMessage(), 0, $e); |
|
551 | + throw new ServiceUnavailable('Encryption not ready: '.$e->getMessage(), 0, $e); |
|
552 | 552 | } |
553 | 553 | if ($e instanceof StorageNotAvailableException) { |
554 | - throw new ServiceUnavailable('Failed to write file contents: ' . $e->getMessage(), 0, $e); |
|
554 | + throw new ServiceUnavailable('Failed to write file contents: '.$e->getMessage(), 0, $e); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $principals = []; |
84 | 84 | |
85 | 85 | if ($prefixPath === $this->principalPrefix) { |
86 | - foreach($this->userManager->search('') as $user) { |
|
86 | + foreach ($this->userManager->search('') as $user) { |
|
87 | 87 | $principals[] = $this->userToPrincipal($user); |
88 | 88 | } |
89 | 89 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $groups = $this->groupManager->getUserGroups($user); |
151 | 151 | $groups = array_map(function($group) { |
152 | 152 | /** @var IGroup $group */ |
153 | - return 'principals/groups/' . $group->getGID(); |
|
153 | + return 'principals/groups/'.$group->getGID(); |
|
154 | 154 | }, $groups); |
155 | 155 | |
156 | 156 | return $groups; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $email = substr($uri, 7); |
202 | 202 | $users = $this->userManager->getByEmail($email); |
203 | 203 | if (count($users) === 1) { |
204 | - return $this->principalPrefix . '/' . $users[0]->getUID(); |
|
204 | + return $this->principalPrefix.'/'.$users[0]->getUID(); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $userId = $user->getUID(); |
217 | 217 | $displayName = $user->getDisplayName(); |
218 | 218 | $principal = [ |
219 | - 'uri' => $this->principalPrefix . '/' . $userId, |
|
219 | + 'uri' => $this->principalPrefix.'/'.$userId, |
|
220 | 220 | '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, |
221 | 221 | ]; |
222 | 222 |
@@ -49,17 +49,17 @@ |
||
49 | 49 | * @param \DOMElement $errorNode |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) { |
|
52 | + public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) { |
|
53 | 53 | |
54 | 54 | // set ownCloud namespace |
55 | 55 | $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); |
56 | 56 | |
57 | 57 | // adding the retry node |
58 | - $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true)); |
|
58 | + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true)); |
|
59 | 59 | $errorNode->appendChild($error); |
60 | 60 | |
61 | 61 | // adding the message node |
62 | - $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage()); |
|
62 | + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage()); |
|
63 | 63 | $errorNode->appendChild($error); |
64 | 64 | } |
65 | 65 | } |
@@ -61,17 +61,17 @@ |
||
61 | 61 | * @param \DOMElement $errorNode |
62 | 62 | * @return void |
63 | 63 | */ |
64 | - public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) { |
|
64 | + public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) { |
|
65 | 65 | |
66 | 66 | // set ownCloud namespace |
67 | 67 | $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); |
68 | 68 | |
69 | 69 | // adding the retry node |
70 | - $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true)); |
|
70 | + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true)); |
|
71 | 71 | $errorNode->appendChild($error); |
72 | 72 | |
73 | 73 | // adding the message node |
74 | - $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage()); |
|
74 | + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage()); |
|
75 | 75 | $errorNode->appendChild($error); |
76 | 76 | } |
77 | 77 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | class FileLocked extends \Sabre\DAV\Exception { |
32 | 32 | |
33 | 33 | public function __construct($message = "", $code = 0, Exception $previous = null) { |
34 | - if($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
34 | + if ($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
35 | 35 | $message = sprintf('Target file %s is locked by another process.', $previous->path); |
36 | 36 | } |
37 | 37 | parent::__construct($message, $code, $previous); |