@@ -280,52 +280,52 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | return $response |
| 283 | - ->setOutputFormat(null) |
|
| 284 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 285 | - $stream = $node->get(); |
|
| 286 | - $name = $node->getName(); |
|
| 283 | + ->setOutputFormat(null) |
|
| 284 | + ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 285 | + $stream = $node->get(); |
|
| 286 | + $name = $node->getName(); |
|
| 287 | 287 | |
| 288 | - if (null === $stream) { |
|
| 289 | - echo ''; |
|
| 288 | + if (null === $stream) { |
|
| 289 | + echo ''; |
|
| 290 | 290 | |
| 291 | - return; |
|
| 292 | - } |
|
| 291 | + return; |
|
| 292 | + } |
|
| 293 | 293 | |
| 294 | - if (0 !== $offset) { |
|
| 295 | - if (fseek($stream, $offset) === -1) { |
|
| 296 | - throw new Exception\Conflict( |
|
| 294 | + if (0 !== $offset) { |
|
| 295 | + if (fseek($stream, $offset) === -1) { |
|
| 296 | + throw new Exception\Conflict( |
|
| 297 | 297 | 'invalid offset requested', |
| 298 | 298 | Exception\Conflict::INVALID_OFFSET |
| 299 | 299 | ); |
| 300 | - } |
|
| 301 | - } |
|
| 302 | - |
|
| 303 | - $read = 0; |
|
| 304 | - if ('base64' === $encode) { |
|
| 305 | - header('Content-Encoding: base64'); |
|
| 306 | - while (!feof($stream)) { |
|
| 307 | - if (0 !== $length && $read + 8192 > $length) { |
|
| 308 | - echo base64_encode(fread($stream, $length - $read)); |
|
| 309 | - exit(); |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - echo base64_encode(fread($stream, 8192)); |
|
| 313 | - $read += 8192; |
|
| 314 | - } |
|
| 315 | - } else { |
|
| 316 | - while (!feof($stream)) { |
|
| 317 | - if (0 !== $length && $read + 8192 > $length) { |
|
| 318 | - echo fread($stream, $length - $read); |
|
| 319 | - exit(); |
|
| 320 | - } |
|
| 321 | - |
|
| 322 | - echo fread($stream, 8192); |
|
| 323 | - $read += 8192; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - exit(); |
|
| 327 | - } |
|
| 328 | - }); |
|
| 300 | + } |
|
| 301 | + } |
|
| 302 | + |
|
| 303 | + $read = 0; |
|
| 304 | + if ('base64' === $encode) { |
|
| 305 | + header('Content-Encoding: base64'); |
|
| 306 | + while (!feof($stream)) { |
|
| 307 | + if (0 !== $length && $read + 8192 > $length) { |
|
| 308 | + echo base64_encode(fread($stream, $length - $read)); |
|
| 309 | + exit(); |
|
| 310 | + } |
|
| 311 | + |
|
| 312 | + echo base64_encode(fread($stream, 8192)); |
|
| 313 | + $read += 8192; |
|
| 314 | + } |
|
| 315 | + } else { |
|
| 316 | + while (!feof($stream)) { |
|
| 317 | + if (0 !== $length && $read + 8192 > $length) { |
|
| 318 | + echo fread($stream, $length - $read); |
|
| 319 | + exit(); |
|
| 320 | + } |
|
| 321 | + |
|
| 322 | + echo fread($stream, 8192); |
|
| 323 | + $read += 8192; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + exit(); |
|
| 327 | + } |
|
| 328 | + }); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -1247,9 +1247,9 @@ discard block |
||
| 1247 | 1247 | $node->zip($archive); |
| 1248 | 1248 | } catch (\Exception $e) { |
| 1249 | 1249 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
| 1250 | - 'category' => get_class($this), |
|
| 1251 | - 'exception' => $e, |
|
| 1252 | - ]); |
|
| 1250 | + 'category' => get_class($this), |
|
| 1251 | + 'exception' => $e, |
|
| 1252 | + ]); |
|
| 1253 | 1253 | } |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $this->logger->info('found first time username ['.$identity->getIdentifier().'], auto-create user', [ |
| 93 | - 'category' => get_class($this), |
|
| 93 | + 'category' => get_class($this), |
|
| 94 | 94 | ]); |
| 95 | 95 | |
| 96 | 96 | $attributes = []; |