Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Changing version down to "1.0" for non 64bit Zips, for MacOSX compata…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
Nik Barham committed Feb 29, 2016
1 parent 6880e64 commit 09fa19e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/ZipStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@
* $zip->finish();
*/
class ZipStream {
const VERSION = '0.1.0';
const ZIP_VERSION = 0x002D;
const VERSION = '0.2.0';
const ZIP_VERSION = 0x000A;
const ZIP_VERSION_64 = 0x002D;

const METHOD_STORE = 0x00;
const METHOD_DEFLATE = 0x08;
Expand Down Expand Up @@ -486,7 +487,7 @@ protected function addFileHeader($name, $opt, $meth) {
$fields = [
// Header
['V', static::FILE_HEADER_SIGNATURE],
['v', static::ZIP_VERSION], // Version needed to Extract
['v', static::ZIP_VERSION_64], // Version needed to Extract
['v', 0b00001000], // General purpose bit flags - data descriptor flag set
['v', $meth], // Compression method
['V', $time], // Timestamp (DOS Format)
Expand Down Expand Up @@ -717,8 +718,8 @@ protected function addCdrFile($args) {
{
$fields = [
['V', static::CDR_FILE_SIGNATURE], // Central file header signature
['v', static::ZIP_VERSION], // Made by version
['v', static::ZIP_VERSION], // Extract by version
['v', static::ZIP_VERSION_64], // Made by version
['v', static::ZIP_VERSION_64], // Extract by version
['v', 0b00001000], // General purpose bit flags - data descriptor flag set
['v', $meth], // Compression method
['V', $time], // Timestamp (DOS Format)
Expand Down Expand Up @@ -793,8 +794,8 @@ protected function addCdr64Eof($opt = null) {
$fields = [
['V', static::ZIP64_CDR_EOF_SIGNATURE], // ZIP64 end of central file header signature
['P', 44], // Length of data below this header (length of block - 12) = 44
['v', static::ZIP_VERSION], // Made by version
['v', static::ZIP_VERSION], // Extract by version
['v', static::ZIP_VERSION_64], // Made by version
['v', static::ZIP_VERSION_64], // Extract by version
['V', 0x00], // disk number
['V', 0x00], // no of disks
['P', $num], // no of entries on disk
Expand Down

0 comments on commit 09fa19e

Please sign in to comment.