*/ 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:----b9hhdLn0MYIZmaNnexVtfqxpU/OXI9I35/BdcpPWpdCMMlvwQJpb9qzLUxlr2Nnhi8/ncRvgLh+fEra6aa/4xGpj9i+FSVMmUq1Ar9CKlgZUSC3qis4BSVchLjPZYwWws1Hn1inY1cacIyJVprITB6TwJ38fGDUodhaALMeuI7ZCtYTo0vbtjppvIun919Nm4FZR51G0FvzwyjoRF4Ey7rjLqDjGGekQ8kkD7/s/4w+cvYH/GG8RwiU5wi7N05Auy3od8+BAqVIJNR5Euf2uWVNX0D90yVnxrtnp1oIWMw3RP59Dr78qTicwhZ00cZbVzKHBuAoGbnNHegI1+y03GDQ3iBkd23EV/LMeZLWF74AHuv8vG3w3qQ7XOgqiBqxx/JwBW5BQGjkWgZlZrNww/N/ZkiJD725Py9fXtRxTEs4j9WGuKdaUYVC8SaGXQHtMD8vRKFSYLljLwQDuo+0Nu/Ms4rbOOc6EsWphI+vRkSZ/x0Vrhj0y2w9XId8AWv4eh0epCWmhFawGdjlXJacVdkuzD1B2xQzyDeXtMIRl2pZ7DbIdhr1fpRpydel/3nIaZFaAfbErLgRdFOBlF6aOhHo4EtbHQW15uHu+QlZN4h2NiYmvbQ2GaffaMmUqyOL0NsXHeoIhdxH0uVleHsz8CCd5jX3rFRDA5FAj8VGX4R4=----ATTACHMENT:----NjkxNTk2MDIwMDc4MDE2NSA4Nzk5ODMwODU3Nzg4NzcyIDQ3MjQ5NjgyODE0MjU3NDc=