@@ -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 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) { |
|
| 186 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) { |
|
| 187 | 187 | if (true === $move) { |
| 188 | 188 | $node = $node->setParent($parent, $conflict); |
| 189 | 189 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | $node = $this->_getNode($id, $p); |
| 262 | 262 | if ($node instanceof Collection) { |
| 263 | - return (new Response())->setBody(function () use ($node) { |
|
| 263 | + return (new Response())->setBody(function() use ($node) { |
|
| 264 | 264 | $node->getZip(); |
| 265 | 265 | }); |
| 266 | 266 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | return $response->setOutputFormat(null) |
| 281 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 281 | + ->setBody(function() use ($node, $encode, $offset, $length) { |
|
| 282 | 282 | $mime = $node->getContentType(); |
| 283 | 283 | $stream = $node->get(); |
| 284 | 284 | $name = $node->getName(); |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | public function postReadonly($id = null, $p = null, bool $readonly = true): Response |
| 351 | 351 | { |
| 352 | - return $this->bulk($id, $p, function ($node) use ($readonly) { |
|
| 352 | + return $this->bulk($id, $p, function($node) use ($readonly) { |
|
| 353 | 353 | $node->setReadonly($readonly); |
| 354 | 354 | |
| 355 | 355 | return ['status' => 204]; |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | */ |
| 595 | 595 | public function postMetaAttributes(?string $id = null, ?string $p = null): Response |
| 596 | 596 | { |
| 597 | - return $this->bulk($id, $p, function ($node) { |
|
| 597 | + return $this->bulk($id, $p, function($node) { |
|
| 598 | 598 | $node->setMetaAttributes($_POST); |
| 599 | 599 | |
| 600 | 600 | return ['status' => 204]; |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | ); |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
| 679 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
| 680 | 680 | $result = $node->copyTo($parent, $conflict); |
| 681 | 681 | |
| 682 | 682 | return [ |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | ); |
| 738 | 738 | } |
| 739 | 739 | |
| 740 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
| 740 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
| 741 | 741 | $result = $node->setParent($parent, $conflict); |
| 742 | 742 | if (NodeInterface::CONFLICT_RENAME === $conflict) { |
| 743 | 743 | return [ |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
| 795 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
| 796 | 796 | if (null === $at) { |
| 797 | 797 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
| 798 | 798 | } else { |