@@ -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 |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | return null; |
72 | 72 | } |
73 | 73 | foreach ($tree as $elem) { |
74 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { |
|
75 | - $shareTypes[] = (int)$elem['value']; |
|
74 | + if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}share-type') { |
|
75 | + $shareTypes[] = (int) $elem['value']; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | return new self($shareTypes); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function xmlSerialize(Writer $writer) { |
88 | 88 | foreach ($this->shareTypes as $shareType) { |
89 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType); |
|
89 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}share-type', $shareType); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -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); |
@@ -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); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
118 | 118 | // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
119 | 119 | // we do not provide locking we emulate it using a fake locking plugin. |
120 | - if($this->request->isUserAgent([ |
|
120 | + if ($this->request->isUserAgent([ |
|
121 | 121 | '/WebDAVFS/', |
122 | 122 | '/Microsoft Office OneNote 2013/', |
123 | 123 | '/Microsoft-WebDAV-MiniRedir/', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // wait with registering these until auth is handled and the filesystem is setup |
133 | - $server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) { |
|
133 | + $server->on('beforeMethod', function() use ($server, $objectTree, $viewCallBack) { |
|
134 | 134 | // ensure the skeleton is copied |
135 | 135 | $userFolder = \OC::$server->getUserFolder(); |
136 | 136 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | ); |
163 | 163 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view)); |
164 | 164 | |
165 | - if($this->userSession->isLoggedIn()) { |
|
165 | + if ($this->userSession->isLoggedIn()) { |
|
166 | 166 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); |
167 | 167 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
168 | 168 | $objectTree, |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // we catch the exception to prevent breaking the whole list with a 404 |
112 | 112 | // (soft fail) |
113 | 113 | \OC::$server->getLogger()->warning( |
114 | - 'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(), |
|
114 | + 'Could not get node for path: \"'.$path.'\" : '.$e->getMessage(), |
|
115 | 115 | array('app' => 'files') |
116 | 116 | ); |
117 | 117 | return; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $statement = $this->connection->prepare( |
171 | 171 | 'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?' |
172 | 172 | ); |
173 | - $statement->execute(array($this->user, '/' . $path)); |
|
173 | + $statement->execute(array($this->user, '/'.$path)); |
|
174 | 174 | $statement->closeCursor(); |
175 | 175 | |
176 | 176 | unset($this->cache[$path]); |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function move($source, $destination) { |
188 | 188 | $statement = $this->connection->prepare( |
189 | - 'UPDATE `*PREFIX*properties` SET `propertypath` = ?' . |
|
189 | + 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'. |
|
190 | 190 | ' WHERE `userid` = ? AND `propertypath` = ?' |
191 | 191 | ); |
192 | - $statement->execute(array('/' . $destination, $this->user, '/' . $source)); |
|
192 | + $statement->execute(array('/'.$destination, $this->user, '/'.$source)); |
|
193 | 193 | $statement->closeCursor(); |
194 | 194 | } |
195 | 195 | |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | private function updateProperties($node, $properties) { |
251 | 251 | $path = $node->getPath(); |
252 | 252 | |
253 | - $deleteStatement = 'DELETE FROM `*PREFIX*properties`' . |
|
253 | + $deleteStatement = 'DELETE FROM `*PREFIX*properties`'. |
|
254 | 254 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
255 | 255 | |
256 | - $insertStatement = 'INSERT INTO `*PREFIX*properties`' . |
|
256 | + $insertStatement = 'INSERT INTO `*PREFIX*properties`'. |
|
257 | 257 | ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)'; |
258 | 258 | |
259 | - $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' . |
|
259 | + $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'. |
|
260 | 260 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
261 | 261 | |
262 | 262 | // TODO: use "insert or update" strategy ? |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | $result = $this->connection->executeQuery( |
331 | 331 | $sql, |
332 | - array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties), |
|
332 | + array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')).'/%', $requestedProperties), |
|
333 | 333 | array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY) |
334 | 334 | ); |
335 | 335 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // verify path of the target |
131 | 131 | $this->verifyPath(); |
132 | 132 | |
133 | - $newPath = $parentPath . '/' . $newName; |
|
133 | + $newPath = $parentPath.'/'.$newName; |
|
134 | 134 | |
135 | 135 | $this->fileView->rename($this->path, $newPath); |
136 | 136 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function getLastModified() { |
152 | 152 | $timestamp = $this->info->getMtime(); |
153 | 153 | if (!empty($timestamp)) { |
154 | - return (int)$timestamp; |
|
154 | + return (int) $timestamp; |
|
155 | 155 | } |
156 | 156 | return $timestamp; |
157 | 157 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @return string |
179 | 179 | */ |
180 | 180 | public function getETag() { |
181 | - return '"' . $this->info->getEtag() . '"'; |
|
181 | + return '"'.$this->info->getEtag().'"'; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | if ($this->info->getId()) { |
218 | 218 | $instanceId = \OC_Util::getInstanceId(); |
219 | 219 | $id = sprintf('%08d', $this->info->getId()); |
220 | - return $id . $instanceId; |
|
220 | + return $id.$instanceId; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | return null; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { |
254 | 254 | /** @var \OCA\Files_Sharing\SharedStorage $storage */ |
255 | - $permissions = (int)$storage->getShare()->getPermissions(); |
|
255 | + $permissions = (int) $storage->getShare()->getPermissions(); |
|
256 | 256 | } else { |
257 | 257 | $permissions = $storage->getPermissions($path); |
258 | 258 | } |