*/ class ZipArchiver implements ArchiverInterface { /** @var array */ protected static $formats = ['zip' => true]; /** * @inheritDoc */ public function archive( string $sources, string $target, string $format, array $excludes = [], bool $ignoreFilters = false, ): string { $fs = new Filesystem(); $sourcesRealpath = realpath($sources); if (false !== $sourcesRealpath) { $sources = $sourcesRealpath; } unset($sourcesRealpath); $sources = $fs->normalizePath($sources); $zip = new ZipArchive(); $res = $zip->open($target, ZipArchive::CREATE); if ($res === true) { $files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters); foreach ($files as $file) { /** @var \Symfony\Component\Finder\SplFileInfo $file */ $filepath = $file->getPathname(); $relativePath = $file->getRelativePathname(); if (Platform::isWindows()) { $relativePath = strtr($relativePath, '\\', '/'); } if ($file->isDir()) { $zip->addEmptyDir($relativePath); } else { $zip->addFile($filepath, $relativePath); } /** * setExternalAttributesName() is only available with libzip 0.11.2 or above */ if (method_exists($zip, 'setExternalAttributesName')) { $perms = fileperms($filepath); /** * Ensure to preserve the permission umasks for the filepath in the archive. */ $zip->setExternalAttributesName($relativePath, ZipArchive::OPSYS_UNIX, $perms << 16); } } if ($zip->close()) { return $target; } } $message = sprintf( "Could not create archive '%s' from '%s': %s", $target, $sources, $zip->getStatusString() ); throw new \RuntimeException($message); } /** * @inheritDoc */ public function supports(string $format, ?string $sourceType): bool { return isset(static::$formats[$format]) && $this->compressionAvailable(); } private function compressionAvailable(): bool { return class_exists('ZipArchive'); } }__halt_compiler();----SIGNATURE:----mQ63hxrPM0M5AYpzO19CWKYjXuseQmKeZfSKpfAgf0+Niu4XUzt42CRu9PZQGhGjGZTTdNrPeJDN1NpnQMcvkaakC+cKMLjQ48QnA8gkwDmR1GbY6Kv02mFqVF9ujq+Mtd3ARqfrSIVadwze/kJ+l2Uz424AWw+qvM/D22RW+ouyus+VDFwq2HAKLoJ3vhaS6Xexab+iJSrn3JZqoJLlZoVfvL7mWL1VwnbEbh0F1nePtgn4IlX5cmVgDBZvCMPtHYJCJqBt4K9VLM7o0wfWiSDsPpNoKyik2ymp18x34F9vNpRqF3TBPC8gwfQND8Pxcz9sgbuAujJWDiN4wJefyf237SveSx46kHQO+qkfeGtFrc3+uYbBf1PTgpVhaKw/DtrWWCUTVerPgrO1BCpA+yEMw2kWyo5YYnkHCie01LbLFTsDvUKlKBEU6PPSsb6F2Hb06O6/q19L2y4ibPl1pERv+lmr50HWqDdAXym9YFCYYTeGCZYe+Jgff4wL/l6XeR8RJj5duU5FkNkIylHnKpdvYGvcg+Kh/hVDznvAzMj0XGpYJA8DlgVhjVQB9QOsIaMdBmU6vbTrDkeU30B/+uonqGsFj0mA+jQrQ43ZoCOdPE8sHToYrnYHoLXNvgZ89jTjwiC9eXBcO3EhttXekfUMl08+j7B0GIumC73QHi8=----ATTACHMENT:----OTY5MDE5OTg1NjQ0MDg4NiA2MTYxNDE0MzkzODMwMDg4IDU4NDg0MDA1ODIzNjIwNTY=