为什么使用PharData创建的ZIP压缩文件未压缩?

时间:2015-09-16 15:01:04

标签: php zip

我尝试使用PharData,因为它似乎提供了创建ZIP或tar档案的好方法。不幸的是,用这种方式创建的ZIP档案根本没有压缩:

/tmp# ls -lah
total 2.3M
drwxrwxrwt  5 root     root 4.0K Sep 16 14:54 .
drwxr-xr-x 82 root     root 4.0K Sep 16 14:54 ..
-rw-------  1 www-data 1000 2.3M Sep  2 16:46 test.csv
/tmp# php -a
Interactive shell

php > $a = new PharData('/tmp/test.zip', null, null, Phar::ZIP);
php > $a->addFile('/tmp/test.csv');
php > exit
/tmp# ls -lah
total 4.6M
drwxrwxrwt  5 root     root 4.0K Sep 16 14:56 .
drwxr-xr-x 82 root     root 4.0K Sep 16 14:54 ..
-rw-------  1 www-data 1000 2.3M Sep  2 16:46 test.csv
-rw-r--r--  1 root     root 2.3M Sep 16 14:56 test.zip

test.csv具有高度可压缩的CSV数据。压缩文件应该有大约500KB。

那么这里有什么问题?

0 个答案:

没有答案
相关问题