QuickAppend 现有的 zip 文件到一个 zip 文件 - 在 PHP 中 [英] QuickAppend existing zip files to a zip file - in PHP

查看:24
本文介绍了QuickAppend 现有的 zip 文件到一个 zip 文件 - 在 PHP 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 PHP 中是否有一种类似的方法可以将多个 zip 文件组合成一个新的 zip 文件而无需重新压缩内容 - 就像这个 zip 文件库:

I was wondering if there is a similar method in PHP to combine multiple zip files into one new zip-file without recompressing the contents - like this zip file library:

http://www.example-code.com/vb/zip_appendFilesToExistingZip.asp

我问的原因是因为这篇关于 Amazon S3 的快速文件压缩的​​文章:

Reason I ask is because of this article on fast file zipping for Amazon S3:

http://www.w2lessons.com/2012/01/fast-zipping-in-amazon-s3.html

看看为什么:

在检查 Chilkat API 时,我注意到存在一个QuickAppend 方法,用于将一个 zip 附加到另一个.我开始想知道如果我们预压缩会如何影响压缩时间S3 中的每个文件,在其目标目录结构中,然后只需将它们全部附加在一起即可形成最终的 zip.令我沮丧的是,压缩时间的差异是惊人的.小 zip 文件100kb-300kb 范围的速度提高了 2x-3x,而那些大于 10mb 看到了 10 到 15 倍的改进.例如,一个 14mb 的 zip25 个文件大小从 100kb 到 8mb 不等,只用了 120ms压缩到最终的 zip,而从头开始构建 zip超过 1.5 秒.

Upon inspecting the Chilkat API, I noticed the existence of a QuickAppend method which serves to append one zip to another. I began wondering how the compression time would be affected if we pre-zipped each file in S3, in its destination directory structure, and then simply appended them all together to form the final zip. To my dismay, the difference in compression time was astonishing. Small zip files in the 100kb-300kb range saw a 2x-3x speed improvement, while those larger than 10mb saw a 10x – 15x improvement. For example, a 14mb zip with 25 files varying in size from 100kb to 8mb took a mere 120ms to compress into the final zip, while building the zip from scratch took over 1.5 seconds.

有人知道 PHP 中的类似技术吗?

Anybody know a similar technique in PHP?

推荐答案

好吧,我没有深入研究 Chillkat 扩展,它们似乎也有一个 PHP 扩展.请参阅:http://www.example-code.com/phpExt/zip_appendFilesToExistingZip.asp

Ok, I didn't look to deep into the Chillkat extensions, they seem to have a PHP extension as well. See: http://www.example-code.com/phpExt/zip_appendFilesToExistingZip.asp

但是,我现在的问题是 - 是否有一个开源 PHP 库可以做同样的事情?

However, my question now would be - is there an open-source PHP library that does the same thing?

这篇关于QuickAppend 现有的 zip 文件到一个 zip 文件 - 在 PHP 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆