| @@ -320,50 +320,50 @@ discard block | ||
| 320 | 320 | } | 
| 321 | 321 | |
| 322 | 322 | return (new Response()) | 
| 323 | - ->setOutputFormat(null) | |
| 324 | -          ->setBody(function () use ($node, $encode, $offset, $length) { | |
| 325 | - $mime = $node->getContentType(); | |
| 326 | - $stream = $node->get(); | |
| 327 | - $name = $node->getName(); | |
| 328 | - | |
| 329 | -              if (null === $stream) { | |
| 330 | - return; | |
| 331 | - } | |
| 332 | - | |
| 333 | -              if (0 !== $offset) { | |
| 334 | -                  if (fseek($stream, $offset) === -1) { | |
| 335 | - throw new Exception\Conflict( | |
| 323 | + ->setOutputFormat(null) | |
| 324 | +            ->setBody(function () use ($node, $encode, $offset, $length) { | |
| 325 | + $mime = $node->getContentType(); | |
| 326 | + $stream = $node->get(); | |
| 327 | + $name = $node->getName(); | |
| 328 | + | |
| 329 | +                if (null === $stream) { | |
| 330 | + return; | |
| 331 | + } | |
| 332 | + | |
| 333 | +                if (0 !== $offset) { | |
| 334 | +                    if (fseek($stream, $offset) === -1) { | |
| 335 | + throw new Exception\Conflict( | |
| 336 | 336 | 'invalid offset requested', | 
| 337 | 337 | Exception\Conflict::INVALID_OFFSET | 
| 338 | 338 | ); | 
| 339 | - } | |
| 340 | - } | |
| 341 | - | |
| 342 | - $read = 0; | |
| 343 | -              header('Content-Type: '.$mime.''); | |
| 344 | -              if ('base64' === $encode) { | |
| 345 | -                  header('Content-Encoding: base64'); | |
| 346 | -                  while (!feof($stream)) { | |
| 347 | -                      if (0 !== $length && $read + 8192 > $length) { | |
| 348 | - echo base64_encode(fread($stream, $length - $read)); | |
| 349 | - exit(); | |
| 350 | - } | |
| 351 | - | |
| 352 | - echo base64_encode(fread($stream, 8192)); | |
| 353 | - $read += 8192; | |
| 354 | - } | |
| 355 | -              } else { | |
| 356 | -                  while (!feof($stream)) { | |
| 357 | -                      if (0 !== $length && $read + 8192 > $length) { | |
| 358 | - echo fread($stream, $length - $read); | |
| 359 | - exit(); | |
| 360 | - } | |
| 361 | - | |
| 362 | - echo fread($stream, 8192); | |
| 363 | - $read += 8192; | |
| 364 | - } | |
| 365 | - } | |
| 366 | - }); | |
| 339 | + } | |
| 340 | + } | |
| 341 | + | |
| 342 | + $read = 0; | |
| 343 | +                header('Content-Type: '.$mime.''); | |
| 344 | +                if ('base64' === $encode) { | |
| 345 | +                    header('Content-Encoding: base64'); | |
| 346 | +                    while (!feof($stream)) { | |
| 347 | +                        if (0 !== $length && $read + 8192 > $length) { | |
| 348 | + echo base64_encode(fread($stream, $length - $read)); | |
| 349 | + exit(); | |
| 350 | + } | |
| 351 | + | |
| 352 | + echo base64_encode(fread($stream, 8192)); | |
| 353 | + $read += 8192; | |
| 354 | + } | |
| 355 | +                } else { | |
| 356 | +                    while (!feof($stream)) { | |
| 357 | +                        if (0 !== $length && $read + 8192 > $length) { | |
| 358 | + echo fread($stream, $length - $read); | |
| 359 | + exit(); | |
| 360 | + } | |
| 361 | + | |
| 362 | + echo fread($stream, 8192); | |
| 363 | + $read += 8192; | |
| 364 | + } | |
| 365 | + } | |
| 366 | + }); | |
| 367 | 367 | } | 
| 368 | 368 | |
| 369 | 369 | /** | 
| @@ -1502,9 +1502,9 @@ discard block | ||
| 1502 | 1502 | $node->zip($archive); | 
| 1503 | 1503 |              } catch (\Exception $e) { | 
| 1504 | 1504 |                  $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ | 
| 1505 | - 'category' => get_class($this), | |
| 1506 | - 'exception' => $e, | |
| 1507 | - ]); | |
| 1505 | + 'category' => get_class($this), | |
| 1506 | + 'exception' => $e, | |
| 1507 | + ]); | |
| 1508 | 1508 | } | 
| 1509 | 1509 | } | 
| 1510 | 1510 | |
| @@ -589,7 +589,7 @@ | ||
| 589 | 589 | ]); | 
| 590 | 590 | |
| 591 | 591 | $this->addVersion($attributes) | 
| 592 | - ->postPutFile($file, $new, $attributes); | |
| 592 | + ->postPutFile($file, $new, $attributes); | |
| 593 | 593 | |
| 594 | 594 | return $this->version; | 
| 595 | 595 | } | 
| @@ -144,18 +144,18 @@ discard block | ||
| 144 | 144 | * @var array | 
| 145 | 145 | */ | 
| 146 | 146 | protected static $valid_attributes = [ | 
| 147 | - 'id', | |
| 148 | - 'username', | |
| 149 | - 'created', | |
| 150 | - 'soft_quota', | |
| 151 | - 'hard_quota', | |
| 152 | - 'mail', | |
| 153 | - 'namespace', | |
| 154 | - 'last_attr_sync', | |
| 155 | - 'avatar', | |
| 156 | - 'created', | |
| 157 | - 'admin', | |
| 158 | - ]; | |
| 147 | + 'id', | |
| 148 | + 'username', | |
| 149 | + 'created', | |
| 150 | + 'soft_quota', | |
| 151 | + 'hard_quota', | |
| 152 | + 'mail', | |
| 153 | + 'namespace', | |
| 154 | + 'last_attr_sync', | |
| 155 | + 'avatar', | |
| 156 | + 'created', | |
| 157 | + 'admin', | |
| 158 | + ]; | |
| 159 | 159 | |
| 160 | 160 | /** | 
| 161 | 161 | * Instance user. | 
| @@ -799,8 +799,8 @@ discard block | ||
| 799 | 799 | |
| 800 | 800 | $ops[] = [ | 
| 801 | 801 | '$sort' => [ | 
| 802 | - 'sum' => -1, | |
| 803 | - '_id' => 1, | |
| 802 | + 'sum' => -1, | |
| 803 | + '_id' => 1, | |
| 804 | 804 | ], | 
| 805 | 805 | ]; | 
| 806 | 806 | |