Completed
Pull Request — master (#228)
by Raffael
22:13
created
src/app/Balloon.App.Api/v2/Nodes.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -958,9 +958,9 @@
 block discarded – undo
958 958
                 $node->zip($archive);
959 959
             } catch (\Exception $e) {
960 960
                 $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [
961
-                   'category' => get_class($this),
962
-                   'exception' => $e,
963
-               ]);
961
+                    'category' => get_class($this),
962
+                    'exception' => $e,
963
+                ]);
964 964
             }
965 965
         }
966 966
 
Please login to merge, or discard this patch.
src/app/Balloon.App.Api/Helper.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -34,68 +34,68 @@
 block discarded – undo
34 34
         }
35 35
 
36 36
         return $response
37
-          ->setOutputFormat(null)
38
-          ->setBody(function () use ($file) {
39
-              $stream = $file->get();
40
-              $name = $file->getName();
41
-
42
-              if (null === $stream) {
43
-                  return;
44
-              }
45
-
46
-              $size = $file->getSize();
47
-              $length = $size;
48
-              $start = 0;
49
-              $end = $size - 1;
50
-
51
-              if (isset($_SERVER['HTTP_RANGE'])) {
52
-                  header('Accept-Ranges: bytes');
53
-                  $c_start = $start;
54
-                  $c_end = $end;
55
-                  list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
56
-
57
-                  if (strpos($range, ',') !== false) {
58
-                      header("Content-Range: bytes $start-$end/$size");
59
-
60
-                      throw new Exception\InvalidRange('invalid offset/limit requested');
61
-                  }
62
-
63
-                  if ($range == '-') {
64
-                      $c_start = $size - substr($range, 1);
65
-                  } else {
66
-                      $range = explode('-', $range);
67
-                      $c_start = $range[0];
68
-                      $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
69
-                  }
70
-
71
-                  $c_end = ($c_end > $end) ? $end : $c_end;
72
-                  if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {
73
-                      header("Content-Range: bytes $start-$end/$size");
74
-
75
-                      throw new Exception\InvalidRange('invalid offset/limit requested');
76
-                  }
77
-
78
-                  $start = (int) $c_start;
79
-                  $end = (int) $c_end;
80
-                  $length = (int) $end - $start + 1;
81
-                  fseek($stream, $start);
82
-                  header('HTTP/1.1 206 Partial Content');
83
-                  header("Content-Range: bytes $start-$end/$size");
84
-              }
85
-
86
-              header('Content-Length: '.$length);
87
-              $buffer = 1024 * 8;
88
-
89
-              while (!feof($stream) && ($p = ftell($stream)) <= $end) {
90
-                  if ($p + $buffer > $end) {
91
-                      $buffer = $end - $p + 1;
92
-                  }
93
-
94
-                  echo fread($stream, $buffer);
95
-                  flush();
96
-              }
97
-
98
-              fclose($stream);
99
-          });
37
+            ->setOutputFormat(null)
38
+            ->setBody(function () use ($file) {
39
+                $stream = $file->get();
40
+                $name = $file->getName();
41
+
42
+                if (null === $stream) {
43
+                    return;
44
+                }
45
+
46
+                $size = $file->getSize();
47
+                $length = $size;
48
+                $start = 0;
49
+                $end = $size - 1;
50
+
51
+                if (isset($_SERVER['HTTP_RANGE'])) {
52
+                    header('Accept-Ranges: bytes');
53
+                    $c_start = $start;
54
+                    $c_end = $end;
55
+                    list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
56
+
57
+                    if (strpos($range, ',') !== false) {
58
+                        header("Content-Range: bytes $start-$end/$size");
59
+
60
+                        throw new Exception\InvalidRange('invalid offset/limit requested');
61
+                    }
62
+
63
+                    if ($range == '-') {
64
+                        $c_start = $size - substr($range, 1);
65
+                    } else {
66
+                        $range = explode('-', $range);
67
+                        $c_start = $range[0];
68
+                        $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
69
+                    }
70
+
71
+                    $c_end = ($c_end > $end) ? $end : $c_end;
72
+                    if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {
73
+                        header("Content-Range: bytes $start-$end/$size");
74
+
75
+                        throw new Exception\InvalidRange('invalid offset/limit requested');
76
+                    }
77
+
78
+                    $start = (int) $c_start;
79
+                    $end = (int) $c_end;
80
+                    $length = (int) $end - $start + 1;
81
+                    fseek($stream, $start);
82
+                    header('HTTP/1.1 206 Partial Content');
83
+                    header("Content-Range: bytes $start-$end/$size");
84
+                }
85
+
86
+                header('Content-Length: '.$length);
87
+                $buffer = 1024 * 8;
88
+
89
+                while (!feof($stream) && ($p = ftell($stream)) <= $end) {
90
+                    if ($p + $buffer > $end) {
91
+                        $buffer = $end - $p + 1;
92
+                    }
93
+
94
+                    echo fread($stream, $buffer);
95
+                    flush();
96
+                }
97
+
98
+                fclose($stream);
99
+            });
100 100
     }
101 101
 }
Please login to merge, or discard this patch.