Is there a way to make Phing ZipTask output a file that can be extracted with a 1.0 version of zip?

88 Views Asked by At

We use Phing on a macOS High Sierra to deploy a WordPress plugin and its ZipTask to build the final archive.

The output of file command against the archives give us this information:

push-notifications-for-wordpress.zip: Zip archive data, at least v2.0 to extract

From which we can see the minimum version to extract archive is v2.0.

Now, we are having troubles with WordPress installer system that does not support those archives:

Could not extract file from archive. push-notifications-for-wordpress/./

If we extract the file and re-create it with the zip command line resulting in a v1.0 compatible file:

push-notifications-for-wordpress.zip: Zip archive data, at least v1.0 to extract

WordPress will successfully extract it and we are reasonably sure that minimum version needed to extract file is the key problem.

So, is there a way to force ZipTask to make a v1.0 compliant zip archive?

Thank you!

1

There are 1 best solutions below

1
cweiske On

With version 2.0, the Zip specification introduced support for folders. Previously it did not:

   4.4.3 version needed to extract (2 bytes)
        4.4.3.2 Current minimum feature versions are as defined below:

         2.0 - File is a folder (directory)
         2.0 - File is compressed using Deflate compression
         2.0 - File is encrypted using traditional PKWARE encryption

Source: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

So it does not make sense to support zip v1 at all, and you have to look for the error elsewhere.