Open
Description
Description
The following code:
$z = new ZipArchive();
$res = $z->open(sys_get_temp_dir().'/temp.zip',ZipArchive::RDONLY |ZipArchive::CHECKCONS);
$datei = $z->getStreamIndex(0,ZipArchive::FL_UNCHANGED);
while ($z = fgets($datei)){
...
delivers only 950 Lines of 1800 in the file - aprox. 100 kB.
Ommitting the Flag ZipArchive::FL_UNCHANGED does not make any difference.
The following code works even with much larger files:
$z = new ZipArchive();
$res = $z->open(sys_get_temp_dir().'/temp.zip',ZipArchive::RDONLY |ZipArchive::CHECKCONS);
$fileName = $z->getNameIndex(0);
$z->close();
$datei = fopen('zip://'.sys_get_temp_dir().'/temp.zip#'.$fileName, 'r');
Tested with
PHP 8.2.26 Development Server in Eclipse
PHP Version
PHP 8.2.26
Operating System
Debian 12