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