| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected function compress() |
||
| 29 | { |
||
| 30 | $gzipPath = $this->originalFilePath.'.gz'; |
||
| 31 | |||
| 32 | if ($gzipOut = gzopen($gzipPath, 'w9')) { |
||
| 33 | if ($gzipIn = fopen($this->originalFilePath, 'rb')) { |
||
| 34 | while (! feof($gzipIn)) { |
||
| 35 | gzwrite($gzipOut, fread($gzipIn, 1024 * 512)); |
||
| 36 | } |
||
| 37 | fclose($gzipIn); |
||
| 38 | } else { |
||
| 39 | return $this->originalFilePath; |
||
| 40 | } |
||
| 41 | |||
| 42 | gzclose($gzipOut); |
||
| 43 | } else { |
||
| 44 | return $this->originalFilePath; |
||
| 45 | } |
||
| 46 | |||
| 47 | return $gzipPath; |
||
| 48 | } |
||
| 49 | |||
| 66 |