]> granicus.if.org Git - php/commitdiff
- Fix flags and tests
authorMarcus Boerger <helly@php.net>
Sat, 20 Jan 2007 16:43:45 +0000 (16:43 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 20 Jan 2007 16:43:45 +0000 (16:43 +0000)
ext/phar/phar.c
ext/phar/tests/015.phpt
ext/phar/tests/015b.phpt
ext/phar/tests/016.phpt
ext/phar/tests/016b.phpt
ext/phar/tests/phar_test.inc

index 36a97acf7613cbc15bc4c8644142b1d7178bb1bc..e3511ab1e9c3a7bcd0427454e3a10152336411c2 100644 (file)
 #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
 
 /* 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
index 32c06fdfd7b4f9fa6aba187e470d76bdd8d0a87d..240537bcf8ed8516d3a89589dfdac7f114ca5816 100644 (file)
@@ -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)
 {
index 1a92dd87852d849800e33aff593fe9aabf83cd00..1cccdd613c70388739c260efe8f5e03d5e601c6f 100755 (executable)
@@ -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)
 {
index 8ffc97bc7333a294f9b8726d7405c33b66da81a5..e4d944104d4d9efba632a51ac74fec861bd0ba2b 100644 (file)
@@ -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)
 {
index 322ec4ea5054c994459148171c05c24622731d15..a58c8bbfd6ad75bbb1f3b2101898ee1ef8b8bca9 100755 (executable)
@@ -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)
 {
index 01b36b3be91ec319e73d67e1dc072283fe5c9456..6f85bfd418a88aa295c60896a26eb39bb6e5c1f7 100755 (executable)
@@ -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);
 }