here is the content of my original zip:
- admin/
- images/
- include/
- index.php
- install.php
- styles/
- template/
- upload/
- web/
If i run this code:
$zip = new ZipArchive;
if ($zip->open('update.zip') === TRUE) {
$zip->deleteName('include/mysql.php');
$zip->deleteName('install.php');
$zip->extractTo('./update/');
$zip->close();
unlink('./update.zip');
} else {
echo 'Fehler';
}
the files that are left are:
- admin/
- images/
- include/
all others are deleted. Any idea why?
Try to close the ZIP file after deleteName(), then open again to extract.