Witam, mam problem... mianowicie nie wiem nawet gdzie go szukać... PHP ignoruje mi pierwsze znaki...
$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) {
$file_in_zip = str_replace($dir."\\", "", $file)."<br>"; 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")) { echo "Ignoruje ".$relativePath."</br>"; } else {
echo "Dodano plik: ".$relativePath."</br>"; $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ć
strpos($relativePath, "nstall\\")
"nstall" zamiast install, a wszystkie skompresowane pliki nie mają pierwszego znaku... Wie ktoś może co jest przyczyną tego błędu ?