McNetic/PHPZipStreamer — pull request #19 by jens-maus (2014-12-07 20:21:43+00:00)
Title: fixed OSX finder compatibility

I am by no means a ZIP expert but as this php module is widely using in owncloud I tried to debug why MacOSX is not able to unarchive zip archives generated by ZipStreamer. While the latest sources in the master branch can now be unarchived with the standard OSX 'unzip' command-line tool, unarchiving using the OSX Finder still failed for some reason.

After debugging I found out that it seems to be related to the data descriptor section that ZipStreamer adds to the zip file while the OSX zip unarchiver seems to expect that the file size and compressed size should be stored in the local file header instead. Thus, I modified ZipStreamer accordingly so that no data descriptor is added at all. The code I am requesting to pull here had been tested in my own owncloud installation and it works fine so far. However, apart from not having tested it widely on other platforms it also can be probably widely optimized since now ZipStreamer has to walk through a file twice to first calculate the dataLength, gzLength and crc32 values and then later again to stream the data out.

But it should be good as a first test bed to identify the necessary steps to finally fix OSX compatibility of ZipStreamer and thus also fix OSX compatibility in owncloud.