I simply cannot make ZipArchive work correctly under windows.
This code
$returnValue = $zipArchive->open(sprintf('%s.zip',$case->getId()), \ZipArchive::CREATE);
if (!is_resource($returnValue)){
exit("".$returnValue." ".sprintf('%s.zip',$case->getId()));
}
foreach($case->getFiles() as $file){
$filePath = $cacheFileManager->getPathPrefix().$file->getLocation();
if(file_exists($filePath)){
$zipArchive->addFile($folderPath, basename($file->getName()));
}else{
exit($filePath);
}
}
$zipArchive->close();
Return value after calling open function is
"1 d08efeaa-2819-11e6-ba08-2c56dc4a62f3.zip"
So I guess that for some reason this error happens "Multi-disk zip archives not supported."
I'm not aware that I did some settings or changes.
Or is ZipArchive not usable under Windows? I'm using PHP 7.
Thanks for any advice
答案 0 :(得分:1)
So my mistake was, that boolean was casted to string, which then results in 1 instead of true.
Second, make sure, that there are some files added. Otherwise there will be error during closing or probably many other operations.
For me, the result is that this library is quite unstable.