*/ 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:----rtJfX42gJ3H7O9xsNNDVz0Xh5IrQ70zZzLN8jwoxLhnmSc2E3oub4g2w8h9l2ZPKQnGSJSKGNXDSlAKvzHHMloL/5sGVh3U4rvAAgSYyVhF5qLt7ELjHiQHJkK2fX04OBYzg+iS/bovJYjIHn773IOUM7taXMYCWBWYL9Kgkj03lU0wR/FfL4nSfjgidirNeWBo75+5c39SuZHCOtL4ZcamAqyoQxH6PDvriICbttXPEOw1y9M2Qb8mdlxSWFpR8a8/SBB85e3bXatujG476GYVhSCJUsq4AfXzpX0RSKldivle6QeOa9SkZ9KJ0NaY/Gl5AMGmI0l6tb1sGFcvJHi9jKe5Vz3Pj7+vxaKiJU8cSCyM5zjTFRXpDKsruyBlgtd8kqAxm0fd+nDF6Q4mOeQ3QzWFFk6pxIzPKDKfPqZF9BIqeMclTdUu+yrTTiMiieJI6tS47epnSdOnSqrHYKpuH1evkuL0WdVdcbL3dZ5SjXMSfAAc2MxfHhBaCbNgyYRHGibSqybeNK+lPnLGhdxBi3iFBepz6Aw05qL4CjyLspHbvEGAxLrOkqkww7x1/68+29Ec5jZb8dmh8PO8YDNCusTmPDfw9lDYZwoRYj4DCDHI+Q/hmBgbfhsyIghL5hCA2WxI7qsfy7cvSYA48U8dkqxZNgT6/lm2qqZzT0dI=----ATTACHMENT:----MzI2NDI4MzMzNzUwMDk3OSA2OTkyNjg2ODYwODcwMTAwIDM4NDE4ODMzNjQwODc0MTk=