@@ -124,10 +124,11 @@ |
||
| 124 | 124 | { |
| 125 | 125 | if(method_exists($this, 'streamToFile')){ |
| 126 | 126 | $this->streamToFile($outputFolder.$this->inArchiveFileName); |
| 127 | - }else{ |
|
| 127 | + } else{ |
|
| 128 | 128 | $data = $this->getFileContent($this->inArchiveFileName); |
| 129 | - if ($data === false) |
|
| 130 | - throw new ArchiveExtractionException('Could not extract archive'); |
|
| 129 | + if ($data === false) { |
|
| 130 | + throw new ArchiveExtractionException('Could not extract archive'); |
|
| 131 | + } |
|
| 131 | 132 | |
| 132 | 133 | $size = strlen($data); |
| 133 | 134 | $written = file_put_contents($outputFolder.$this->inArchiveFileName, $data); |
@@ -98,10 +98,12 @@ |
||
| 98 | 98 | $fp = fopen($targetPath, "w"); |
| 99 | 99 | while (!gzeof($sfp)) { |
| 100 | 100 | $chunk = gzread($sfp, 8192); |
| 101 | - if($chunk === 0 || $chunk === false) |
|
| 102 | - throw new ArchiveExtractionException('Cannot read gzip chunk'); |
|
| 103 | - if(fwrite($fp, $chunk, strlen($chunk)) === false) |
|
| 104 | - throw new ArchiveExtractionException('Cannot write gzip chunk'); |
|
| 101 | + if($chunk === 0 || $chunk === false) { |
|
| 102 | + throw new ArchiveExtractionException('Cannot read gzip chunk'); |
|
| 103 | + } |
|
| 104 | + if(fwrite($fp, $chunk, strlen($chunk)) === false) { |
|
| 105 | + throw new ArchiveExtractionException('Cannot write gzip chunk'); |
|
| 106 | + } |
|
| 105 | 107 | } |
| 106 | 108 | gzclose($sfp); |
| 107 | 109 | fclose($fp); |