| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function unarchive(string $source, string $target): bool |
||
| 22 | { |
||
| 23 | $file = gzopen($source, 'rb'); |
||
| 24 | $output = fopen($target, 'wb'); |
||
| 25 | |||
| 26 | while (!gzeof($file)) { |
||
| 27 | if (false === fwrite($output, gzread($file, 4096))) { |
||
| 28 | return false; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | fclose($output); |
||
| 33 | gzclose($file); |
||
| 34 | |||
| 35 | return true; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |