@@ -75,7 +75,7 @@ |
||
| 75 | 75 | |
| 76 | 76 | $this->logger->info('new group ['.$result.'] created', [ |
| 77 | 77 | 'category' => get_class($this), |
| 78 | - ]); |
|
| 78 | + ]); |
|
| 79 | 79 | |
| 80 | 80 | return true; |
| 81 | 81 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | 'foreignField' => '_id', |
| 50 | 50 | 'localField' => 'history.storage._id', |
| 51 | 51 | 'as' => 'blob', |
| 52 | - ]], |
|
| 52 | + ]], |
|
| 53 | 53 | ]); |
| 54 | 54 | |
| 55 | 55 | foreach ($cursor as $object) { |
@@ -273,37 +273,37 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | return $response |
| 276 | - ->setOutputFormat(null) |
|
| 277 | - ->setBody(function () use ($node, $offset, $limit) { |
|
| 278 | - $stream = $node->get(); |
|
| 279 | - $name = $node->getName(); |
|
| 280 | - |
|
| 281 | - if (null === $stream) { |
|
| 282 | - return; |
|
| 283 | - } |
|
| 284 | - |
|
| 285 | - if (0 !== $offset) { |
|
| 286 | - if (fseek($stream, $offset) === -1) { |
|
| 287 | - throw new Exception\Conflict( |
|
| 276 | + ->setOutputFormat(null) |
|
| 277 | + ->setBody(function () use ($node, $offset, $limit) { |
|
| 278 | + $stream = $node->get(); |
|
| 279 | + $name = $node->getName(); |
|
| 280 | + |
|
| 281 | + if (null === $stream) { |
|
| 282 | + return; |
|
| 283 | + } |
|
| 284 | + |
|
| 285 | + if (0 !== $offset) { |
|
| 286 | + if (fseek($stream, $offset) === -1) { |
|
| 287 | + throw new Exception\Conflict( |
|
| 288 | 288 | 'invalid offset requested', |
| 289 | 289 | Exception\Conflict::INVALID_OFFSET |
| 290 | 290 | ); |
| 291 | - } |
|
| 292 | - } |
|
| 293 | - |
|
| 294 | - $read = 0; |
|
| 295 | - while (!feof($stream)) { |
|
| 296 | - if (0 !== $limit && $read + 8192 > $limit) { |
|
| 297 | - echo fread($stream, $limit - $read); |
|
| 298 | - exit(); |
|
| 299 | - } |
|
| 300 | - |
|
| 301 | - echo fread($stream, 8192); |
|
| 302 | - $read += 8192; |
|
| 303 | - } |
|
| 304 | - |
|
| 305 | - exit(); |
|
| 306 | - }); |
|
| 291 | + } |
|
| 292 | + } |
|
| 293 | + |
|
| 294 | + $read = 0; |
|
| 295 | + while (!feof($stream)) { |
|
| 296 | + if (0 !== $limit && $read + 8192 > $limit) { |
|
| 297 | + echo fread($stream, $limit - $read); |
|
| 298 | + exit(); |
|
| 299 | + } |
|
| 300 | + |
|
| 301 | + echo fread($stream, 8192); |
|
| 302 | + $read += 8192; |
|
| 303 | + } |
|
| 304 | + |
|
| 305 | + exit(); |
|
| 306 | + }); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | /** |
@@ -1053,9 +1053,9 @@ discard block |
||
| 1053 | 1053 | $node->zip($archive); |
| 1054 | 1054 | } catch (\Exception $e) { |
| 1055 | 1055 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
| 1056 | - 'category' => get_class($this), |
|
| 1057 | - 'exception' => $e, |
|
| 1058 | - ]); |
|
| 1056 | + 'category' => get_class($this), |
|
| 1057 | + 'exception' => $e, |
|
| 1058 | + ]); |
|
| 1059 | 1059 | } |
| 1060 | 1060 | } |
| 1061 | 1061 | |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | break; |
| 102 | 102 | default: |
| 103 | 103 | throw new InvalidArgumentException('invalid option '.$option.' given'); |
| 104 | - } |
|
| 104 | + } |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $this; |
@@ -114,10 +114,10 @@ |
||
| 114 | 114 | $body->setParts([$html, $plain]); |
| 115 | 115 | |
| 116 | 116 | $mail = (new Message()) |
| 117 | - ->setSubject($message->getSubject($receiver)) |
|
| 118 | - ->setBody($body) |
|
| 119 | - ->setTo($address) |
|
| 120 | - ->setEncoding('UTF-8'); |
|
| 117 | + ->setSubject($message->getSubject($receiver)) |
|
| 118 | + ->setBody($body) |
|
| 119 | + ->setTo($address) |
|
| 120 | + ->setEncoding('UTF-8'); |
|
| 121 | 121 | |
| 122 | 122 | $type = $mail->getHeaders()->get('Content-Type'); |
| 123 | 123 | $type->setType('multipart/alternative'); |
@@ -256,9 +256,9 @@ |
||
| 256 | 256 | $body->setParts([$html, $plain]); |
| 257 | 257 | |
| 258 | 258 | $mail = (new Message()) |
| 259 | - ->setSubject($message->getSubject()) |
|
| 260 | - ->setBody($body) |
|
| 261 | - ->setEncoding('UTF-8'); |
|
| 259 | + ->setSubject($message->getSubject()) |
|
| 260 | + ->setBody($body) |
|
| 261 | + ->setEncoding('UTF-8'); |
|
| 262 | 262 | |
| 263 | 263 | $type = $mail->getHeaders()->get('Content-Type'); |
| 264 | 264 | $type->setType('multipart/alternative'); |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | $this->identity = $user; |
| 535 | 535 | $user->updateIdentity($identity) |
| 536 | - ->updateShares(); |
|
| 536 | + ->updateShares(); |
|
| 537 | 537 | $this->hook->run('postServerIdentity', [$user]); |
| 538 | 538 | |
| 539 | 539 | return true; |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | public function getGroupByName(string $name): Group |
| 643 | 643 | { |
| 644 | 644 | $group = $this->db->group->findOne([ |
| 645 | - 'name' => $name, |
|
| 645 | + 'name' => $name, |
|
| 646 | 646 | ]); |
| 647 | 647 | |
| 648 | 648 | if (null === $group) { |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | $group = $this->db->group->findOne([ |
| 667 | - '_id' => $id, |
|
| 667 | + '_id' => $id, |
|
| 668 | 668 | ]); |
| 669 | 669 | |
| 670 | 670 | if (null === $group) { |
@@ -278,49 +278,49 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | return $response->setOutputFormat(null) |
| 281 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 282 | - $mime = $node->getContentType(); |
|
| 283 | - $stream = $node->get(); |
|
| 284 | - $name = $node->getName(); |
|
| 285 | - |
|
| 286 | - if (null === $stream) { |
|
| 287 | - return; |
|
| 288 | - } |
|
| 289 | - |
|
| 290 | - if (0 !== $offset) { |
|
| 291 | - if (fseek($stream, $offset) === -1) { |
|
| 292 | - throw new Exception\Conflict( |
|
| 281 | + ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 282 | + $mime = $node->getContentType(); |
|
| 283 | + $stream = $node->get(); |
|
| 284 | + $name = $node->getName(); |
|
| 285 | + |
|
| 286 | + if (null === $stream) { |
|
| 287 | + return; |
|
| 288 | + } |
|
| 289 | + |
|
| 290 | + if (0 !== $offset) { |
|
| 291 | + if (fseek($stream, $offset) === -1) { |
|
| 292 | + throw new Exception\Conflict( |
|
| 293 | 293 | 'invalid offset requested', |
| 294 | 294 | Exception\Conflict::INVALID_OFFSET |
| 295 | 295 | ); |
| 296 | - } |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - $read = 0; |
|
| 300 | - header('Content-Type: '.$mime.''); |
|
| 301 | - if ('base64' === $encode) { |
|
| 302 | - header('Content-Encoding: base64'); |
|
| 303 | - while (!feof($stream)) { |
|
| 304 | - if (0 !== $length && $read + 8192 > $length) { |
|
| 305 | - echo base64_encode(fread($stream, $length - $read)); |
|
| 306 | - exit(); |
|
| 307 | - } |
|
| 308 | - |
|
| 309 | - echo base64_encode(fread($stream, 8192)); |
|
| 310 | - $read += 8192; |
|
| 311 | - } |
|
| 312 | - } else { |
|
| 313 | - while (!feof($stream)) { |
|
| 314 | - if (0 !== $length && $read + 8192 > $length) { |
|
| 315 | - echo fread($stream, $length - $read); |
|
| 316 | - exit(); |
|
| 317 | - } |
|
| 318 | - |
|
| 319 | - echo fread($stream, 8192); |
|
| 320 | - $read += 8192; |
|
| 321 | - } |
|
| 322 | - } |
|
| 323 | - }); |
|
| 296 | + } |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + $read = 0; |
|
| 300 | + header('Content-Type: '.$mime.''); |
|
| 301 | + if ('base64' === $encode) { |
|
| 302 | + header('Content-Encoding: base64'); |
|
| 303 | + while (!feof($stream)) { |
|
| 304 | + if (0 !== $length && $read + 8192 > $length) { |
|
| 305 | + echo base64_encode(fread($stream, $length - $read)); |
|
| 306 | + exit(); |
|
| 307 | + } |
|
| 308 | + |
|
| 309 | + echo base64_encode(fread($stream, 8192)); |
|
| 310 | + $read += 8192; |
|
| 311 | + } |
|
| 312 | + } else { |
|
| 313 | + while (!feof($stream)) { |
|
| 314 | + if (0 !== $length && $read + 8192 > $length) { |
|
| 315 | + echo fread($stream, $length - $read); |
|
| 316 | + exit(); |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + echo fread($stream, 8192); |
|
| 320 | + $read += 8192; |
|
| 321 | + } |
|
| 322 | + } |
|
| 323 | + }); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -1321,9 +1321,9 @@ discard block |
||
| 1321 | 1321 | $node->zip($archive); |
| 1322 | 1322 | } catch (\Exception $e) { |
| 1323 | 1323 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
| 1324 | - 'category' => get_class($this), |
|
| 1325 | - 'exception' => $e, |
|
| 1326 | - ]); |
|
| 1324 | + 'category' => get_class($this), |
|
| 1325 | + 'exception' => $e, |
|
| 1326 | + ]); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | |
@@ -502,7 +502,7 @@ |
||
| 502 | 502 | $this->increaseVersion(); |
| 503 | 503 | |
| 504 | 504 | $this->addVersion($attributes) |
| 505 | - ->postPutFile(); |
|
| 505 | + ->postPutFile(); |
|
| 506 | 506 | |
| 507 | 507 | return $this->version; |
| 508 | 508 | } |