mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-08-03 05:57:25 +02:00
fix close container in ZipFile::close()
This commit is contained in:
@@ -1797,8 +1797,9 @@ class ZipFile implements ZipFileInterface
|
|||||||
if ($this->reader !== null) {
|
if ($this->reader !== null) {
|
||||||
$this->reader->close();
|
$this->reader->close();
|
||||||
$this->reader = null;
|
$this->reader = null;
|
||||||
$this->zipContainer = $this->createZipContainer(null);
|
|
||||||
}
|
}
|
||||||
|
$this->zipContainer = $this->createZipContainer(null);
|
||||||
|
gc_collect_cycles();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace PhpZip\Tests;
|
namespace PhpZip\Tests;
|
||||||
|
|
||||||
|
use PhpZip\Constants\ZipCompressionMethod;
|
||||||
use PhpZip\Exception\ZipException;
|
use PhpZip\Exception\ZipException;
|
||||||
use PhpZip\ZipFile;
|
use PhpZip\ZipFile;
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ class Zip64Test extends ZipTestCase
|
|||||||
|
|
||||||
$zipFile = new ZipFile();
|
$zipFile = new ZipFile();
|
||||||
for ($i = 0; $i < $countFiles; $i++) {
|
for ($i = 0; $i < $countFiles; $i++) {
|
||||||
$zipFile[$i . '.txt'] = (string) $i;
|
$zipFile->addFromString($i . '.txt', (string) $i, ZipCompressionMethod::STORED);
|
||||||
}
|
}
|
||||||
$zipFile->saveAsFile($this->outputFilename);
|
$zipFile->saveAsFile($this->outputFilename);
|
||||||
$zipFile->close();
|
$zipFile->close();
|
||||||
|
Reference in New Issue
Block a user