$zip = new ZipArchive; $zip->open('update-'.$version.'.zip', ZipArchive::CREATE | ZipArchive::EXCL); $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($rootPath), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($files as $name => $file) { if (!$file->isDir()) { // Get real and relative path for current file $filePath = $file->getRealPath(); // Add current file to archive if (strpos($relativePath, "nstall\\") or strpos($relativePath, "ake-update.php") or strpos($relativePath, "old\\") or strpos($relativePath, "zepsuty") or strpos($relativePath, "lobal\config.php") or strpos($relativePath, "vs\\") or strpos($relativePath, "git\\") or strpos($relativePath, "idea\\") or strpos($relativePath, "pload\\") or strpos($relativePath, "cache\\") or strpos($relativePath, 'ploads\\') or strpos($relativePath, "emplates_c")) { } else { $zip->addFile($filePath, $path_in_zip, true); } } } $zip->close();
mam taki kod.. i wszystko dobrze by było gdyby nie to że muszę użyć
"nstall" zamiast install, a wszystkie skompresowane pliki nie mają pierwszego znaku... Wie ktoś może co jest przyczyną tego błędu ?