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