| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 2 | public function decompress($zipContent, $fileToExtract) |
|
| 42 | { |
||
| 43 | 2 | $temp = tempnam(sys_get_temp_dir(),time() . '.zip'); |
|
| 44 | 2 | file_put_contents($temp, $zipContent); |
|
| 45 | 2 | $zip = new ZipArchive; |
|
| 46 | 2 | $output = ""; |
|
| 47 | 2 | if ($zip->open($temp) === true) { |
|
| 48 | 2 | $output = $zip->getFromName($fileToExtract); |
|
| 49 | 2 | } |
|
| 50 | 2 | $zip->close(); |
|
| 51 | 2 | unlink($temp); |
|
| 52 | |||
| 53 | 2 | return $output; |
|
| 54 | } |
||
| 55 | |||
| 76 | } |