1
0
mirror of https://github.com/splitbrain/php-archive.git synced 2025-03-15 11:39:42 +01:00

correctly remove temporary files when uncompressing ZIPs

This commit is contained in:
Andreas Gohr 2015-07-24 13:29:49 +02:00
parent 89b4cba038
commit a8881f4e07
3 changed files with 5 additions and 0 deletions

View File

@ -223,6 +223,7 @@ class Zip extends Archive
}
fclose($fp);
gzclose($gzp);
unlink($extractto); // remove temporary gz file
}
touch($output, $fileinfo->getMtime());

View File

@ -140,6 +140,10 @@ class Zip_TestCase extends PHPUnit_Framework_TestCase
$this->assertFileExists($out.'/zip/foobar/testdata2.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/zip/foobar/testdata2.txt'), "Extracted $file");
$this->assertFileExists($out.'/zip/compressable.txt', "Extracted $file");
$this->assertEquals(1836, filesize($out.'/zip/compressable.txt'), "Extracted $file");
$this->assertFileNotExists($out.'/zip/compressable.txt.gz', "Extracted $file");
self::rdelete($out);
}

Binary file not shown.