From 154de1819e8036bd73b0c70ba23769c570630b13 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 20 Jan 2007 16:43:45 +0000 Subject: [PATCH] - Fix flags and tests --- ext/phar/phar.c | 16 ++++++++-------- ext/phar/tests/015.phpt | 4 ++-- ext/phar/tests/015b.phpt | 4 ++-- ext/phar/tests/016.phpt | 8 ++++---- ext/phar/tests/016b.phpt | 4 ++-- ext/phar/tests/phar_test.inc | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 36a97acf76..e3511ab1e9 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -60,11 +60,11 @@ #define PHAR_API_MAJORVER_MASK 0xF000 #define PHAR_API_VER_MASK 0xFFF0 -#define PHAR_HDR_COMPRESSION_MASK 0x000F -#define PHAR_HDR_COMPRESSED_NONE 0x000F -#define PHAR_HDR_COMPRESSED_GZ 0x0001 -#define PHAR_HDR_COMPRESSED_BZ2 0x0002 -#define PHAR_HDR_SIGNATURE 0x0010 +#define PHAR_HDR_COMPRESSION_MASK 0x0000F000 +#define PHAR_HDR_COMPRESSED_NONE 0x00000000 +#define PHAR_HDR_COMPRESSED_GZ 0x00001000 +#define PHAR_HDR_COMPRESSED_BZ2 0x00002000 +#define PHAR_HDR_SIGNATURE 0x00010000 #define PHAR_SIG_MD5 0x0001 #define PHAR_SIG_SHA1 0x0002 @@ -82,10 +82,10 @@ /* flags byte for each file adheres to these bitmasks. All unused values are reserved */ -#define PHAR_ENT_COMPRESSION_MASK 0x00001C00 +#define PHAR_ENT_COMPRESSION_MASK 0x0000F000 #define PHAR_ENT_COMPRESSED_NONE 0x00000000 -#define PHAR_ENT_COMPRESSED_GZ 0x00000200 -#define PHAR_ENT_COMPRESSED_BZ2 0x00000400 +#define PHAR_ENT_COMPRESSED_GZ 0x00001000 +#define PHAR_ENT_COMPRESSED_BZ2 0x00002000 #define PHAR_ENT_PERM_MASK 0x000001FF #define PHAR_ENT_PERM_MASK_USR 0x000001C0 diff --git a/ext/phar/tests/015.phpt b/ext/phar/tests/015.phpt index 32c06fdfd7..240537bcf8 100644 --- a/ext/phar/tests/015.phpt +++ b/ext/phar/tests/015.phpt @@ -16,10 +16,10 @@ $files['a'] = 'a'; $manifest = ''; foreach($files as $name => $cont) { $len = strlen($cont); - $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', $len, time(), 3, crc32($cont), 0x00000001); + $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', $len, time(), 3, crc32($cont), 0x00001000); } $alias = 'hio'; -$manifest = pack('VnVV', count($files), 0x0900, 0x00000001, strlen($alias)) . $alias . $manifest; +$manifest = pack('VnVV', count($files), 0x0900, 0x00001000, strlen($alias)) . $alias . $manifest; $file .= pack('V', strlen($manifest)) . $manifest; foreach($files as $cont) { diff --git a/ext/phar/tests/015b.phpt b/ext/phar/tests/015b.phpt index 1a92dd8785..1cccdd613c 100755 --- a/ext/phar/tests/015b.phpt +++ b/ext/phar/tests/015b.phpt @@ -15,10 +15,10 @@ $files = array(); $files['a'] = array('Hello World', pack('H*', '425a6839314159265359d872012f00000157800010400000400080060490002000220686d420c988c769e8281f8bb9229c28486c39009780')); $manifest = ''; foreach($files as $name => $cont) { - $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', strlen($cont[0]), time(), strlen($cont[1]), crc32($cont[0]), 0x00000002); + $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', strlen($cont[0]), time(), strlen($cont[1]), crc32($cont[0]), 0x00002000); } $alias = 'hio'; -$manifest = pack('VnVV', count($files), 0x0900, 0x00000002, strlen($alias)) . $alias . $manifest; +$manifest = pack('VnVV', count($files), 0x0900, 0x00002000, strlen($alias)) . $alias . $manifest; $file .= pack('V', strlen($manifest)) . $manifest; foreach($files as $cont) { diff --git a/ext/phar/tests/016.phpt b/ext/phar/tests/016.phpt index 8ffc97bc73..e4d944104d 100644 --- a/ext/phar/tests/016.phpt +++ b/ext/phar/tests/016.phpt @@ -13,10 +13,10 @@ __HALT_COMPILER(); ?>"; // file length is too short $files = array(); -$files['a'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00000001); -$files['b'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00000001); +$files['a'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00001000); +$files['b'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00001000); $files['c'] = array('*', '*', 0x00000000); -$files['d'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00000001); +$files['d'] = array('a', chr(75)/*. chr(4) . chr(0): 'a' gzdeflated */, 0x00001000); $manifest = ''; foreach($files as $name => $cont) { $ulen = strlen($cont[0]); @@ -25,7 +25,7 @@ foreach($files as $name => $cont) { . pack('VVVVV', $ulen, time(), $clen, crc32($cont[0]), $cont[2]); } $alias = 'hio'; -$manifest = pack('VnVV', count($files), 0x0900, 0x00000001, strlen($alias)) . $alias . $manifest; +$manifest = pack('VnVV', count($files), 0x0900, 0x00001000, strlen($alias)) . $alias . $manifest; $file .= pack('V', strlen($manifest)) . $manifest; foreach($files as $cont) { diff --git a/ext/phar/tests/016b.phpt b/ext/phar/tests/016b.phpt index 322ec4ea50..a58c8bbfd6 100755 --- a/ext/phar/tests/016b.phpt +++ b/ext/phar/tests/016b.phpt @@ -17,10 +17,10 @@ $files['a'] = 'a'; $manifest = ''; foreach($files as $name => $cont) { $len = strlen($cont); - $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', $len, time(), 1, crc32($cont), 0x00000001); + $manifest .= pack('V', strlen($name)) . $name . pack('VVVVV', $len, time(), 1, crc32($cont), 0x00001000); } $alias = 'hio'; -$manifest = pack('VnVV', count($files), 0x0900, 0x00000001, strlen($alias)) . $alias . $manifest; +$manifest = pack('VnVV', count($files), 0x0900, 0x00001000, strlen($alias)) . $alias . $manifest; $file .= pack('V', strlen($manifest)) . $manifest; foreach($files as $cont) { diff --git a/ext/phar/tests/phar_test.inc b/ext/phar/tests/phar_test.inc index 01b36b3be9..6f85bfd418 100755 --- a/ext/phar/tests/phar_test.inc +++ b/ext/phar/tests/phar_test.inc @@ -6,7 +6,7 @@ foreach($files as $name => $cont) { $ulen = strlen($cont); $clen = $ulen; - $time = isset($ftime) ? $ftime : mktime(12, 0, 0, 3, 1, 2006); + $time = isset($ftime) ? $ftime : @mktime(12, 0, 0, 3, 1, 2006); $manifest .= pack('V', strlen($name)) . $name; $manifest .= pack('VVVVV', $ulen, $time, $clen, crc32($cont), 0x000001B6); } -- 2.50.1