sfox            Sun May 18 20:52:34 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/phar   shortarc.php stub.h 
    /php-src/ext/phar/tests/files       nophar.phar phar_test.inc 
    /php-src/ext/phar/tests     phar_commitwrite.phpt 
                                phar_convert_repeated.phpt 
                                phar_create_in_cwd.phpt 
                                phar_createdefaultstub.phpt 
                                phar_offset_check.phpt 
                                phar_setdefaultstub.phpt 
    /php-src/ext/phar/tests/tar/files   make_invalid_tar.php.inc 
                                        tarmaker.php.inc 
    /php-src/ext/phar/tests/tar phar_convert_phar.phpt 
                                phar_convert_phar2.phpt 
                                phar_convert_phar3.phpt 
    /php-src/ext/phar/tests/zip phar_convert_phar.phpt 
  Log:
  - Keep 5_3 stub and creation files in sync with what I have in CVS HEAD
  (MFB will likely be tomorrow now)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/shortarc.php?r1=1.12.2.1&r2=1.12.2.2&diff_format=u
Index: php-src/ext/phar/shortarc.php
diff -u php-src/ext/phar/shortarc.php:1.12.2.1 
php-src/ext/phar/shortarc.php:1.12.2.2
--- php-src/ext/phar/shortarc.php:1.12.2.1      Wed May 14 21:29:51 2008
+++ php-src/ext/phar/shortarc.php       Sun May 18 20:52:33 2008
@@ -114,15 +114,15 @@
     {
         $fp = fopen(__FILE__, 'rb');
         fseek($fp, self::LEN);
-        $L = unpack('V', $a = fread($fp, 4));
-        $m = '';
+        $L = unpack('V', $a = (binary)fread($fp, 4));
+        $m = (binary)'';
 
         do {
             $read = 8192;
             if ($L[1] - strlen($m) < 8192) {
                 $read = $L[1] - strlen($m);
             }
-            $last = fread($fp, $read);
+            $last = (binary)fread($fp, $read);
             $m .= $last;
         } while (strlen($last) && strlen($m) < $L[1]);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/stub.h?r1=1.13.2.1&r2=1.13.2.2&diff_format=u
Index: php-src/ext/phar/stub.h
diff -u php-src/ext/phar/stub.h:1.13.2.1 php-src/ext/phar/stub.h:1.13.2.2
--- php-src/ext/phar/stub.h:1.13.2.1    Wed May 14 21:29:51 2008
+++ php-src/ext/phar/stub.h     Sun May 18 20:52:33 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: stub.h,v 1.13.2.1 2008/05/14 21:29:51 sfox Exp $ */
+/* $Id: stub.h,v 1.13.2.2 2008/05/18 20:52:33 sfox Exp $ */
 
 static inline void phar_get_stub(const char *index_php, const char *web, 
size_t *len, char **stub, const int name_len, const int web_len TSRMLS_DC)
 {
@@ -24,10 +24,11 @@
        static const char newstub1_0[] = "';\n\nif (in_array('phar', 
stream_get_wrappers()) && class_exists('Phar', 0)) 
{\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . 
PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 
'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif 
(@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && 
($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) 
{\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 
'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 
'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 
'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 
'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 
'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 
'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 
'image/x-ico',!
 \n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 
'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 
'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 
'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 
'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 
'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 
'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 
'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, 
must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = 
basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) 
{\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = 
substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + 
strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 
301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . 
$pt);\nexit;\n}\n!
 $a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!
$a || strlen(dirname($a)) < strlen(";
        static const char newstub1_1[] = "Extract_Phar::$temp)) 
{\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n  <title>File 
Not Found<title>\\n </head>\\n <body>\\n  <h1>404 - File \", $pt, \" Not 
Found</h1>\\n </body>\\n</html>\";\nexit;\n}\n$b = pathinfo($a);\nif 
(!isset($b['extension'])) {\nheader('Content-Type: 
text/plain');\nheader('Content-Length: ' . 
filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) 
{\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif 
($mimes[$b['extension']] === 2) 
{\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' 
.$mimes[$b['extension']]);\nheader('Content-Length: ' . 
filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic 
$temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 
0x3000;\nconst START = '";
        static const char newstub2[] = "';\nconst LEN = ";
-       static const char newstub3_0[] = ";\n\nstatic function go($return = 
false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = 
unpack('V', $a = fread($fp, 4));\n$m = '';\n\ndo {\n$read = 8192;\nif ($L[1] - 
strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = fread($fp, 
$read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif 
(strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) 
.'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = 
$info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) 
{\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function 
needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif 
(!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not 
enabled -' .\n' bzdecompress() function needed for bz2-compressed 
.phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || 
!is_writable($temp)) {\n$sessionpath = session_sa!
 ve_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr 
($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) 
|| !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to 
extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= 
'/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = 
$temp;\nself::$origdir = getcwd();[EMAIL PROTECTED]($temp, 0777, true);\n$temp 
= realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . 
md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());[EMAIL 
PROTECTED]($temp, 0777, true);[EMAIL PROTECTED]($temp . '/' . 
md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = 
!file_exists(dirname($temp . '/' . $path));[EMAIL PROTECTED](dirname($temp . 
'/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] 
== '/') [EMAIL PROTECTED]($temp . '/' . $path, 0777);\n} else 
{\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, 
$fp));[EMAIL PROTECTED]($temp . '!
 /' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclu
de self::START;\n}\n}\n\nstatic fun";
-       static const char newstub3_1[] = "ction tmpdir()\n{\nif (strpos(PHP_OS, 
'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) 
{\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn 
realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn 
$var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info 
= unpack('V', substr($m, 0, 4));\n $l = unpack('V', substr($m, 10, 4));\n$m = 
substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 
4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n $len = 
unpack('V', substr($m, $start, 4));\n$start += 4;\n $savepath = substr($m, 
$start, $len[1]);\n$start += $len[1];\n   $ret['m'][$savepath] = 
array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 
24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 
0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += 
$ret['m'][$savepath][2];\n$start += 24 + $ret['m!
 '][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & 
self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, 
$fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data 
.= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 
8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} 
elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif 
(strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error 
\" . strlen($data) . \" != \" .\n$stat[7] . \")\");\n}\n\nif ($entry[3] != 
sprintf(\"%u\", crc32((binary)$data) & 0xffffffff)) {\ndie(\"Invalid internal 
.phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function 
_removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) 
{\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif 
(file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());[EMAIL 
PROTECTED]($temp);!
 \nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__
HALT_COMPILER(); ?>";
+       static const char newstub3_0[] = ";\n\nstatic function go($return = 
false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = 
unpack('V', $a = (binary)fread($fp, 4));\n$m = (binary)'';\n\ndo {\n$read = 
8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last 
= (binary)fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && 
strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length 
read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = 
self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif 
(!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' 
.\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f 
& self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 
extension is not enabled -' .\n' bzdecompress() function needed for 
bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || 
!is_writable($temp)) {\n$!
 sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== 
false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, 
\";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) 
{\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = 
$sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, 
'.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();[EMAIL 
PROTECTED]($temp, 0777, true);\n$temp = realpath($temp);\n\nif 
(!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) 
{\nself::_removeTmpFiles($temp, getcwd());[EMAIL PROTECTED]($temp, 0777, 
true);[EMAIL PROTECTED]($temp . '/' . md5_file(__FILE__), '');\n\nforeach 
($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . 
$path));[EMAIL PROTECTED](dirname($temp . '/' . $path), 0777, 
true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') [EMAIL 
PROTECTED]($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' 
. $path, self::extractFile($path, $file, !
 $fp));[EMAIL PROTECTED]($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n
\nif (!$return) {\ninclude self::ST";
+       static const char newstub3_1[] = "ART;\n}\n}\n\nstatic function 
tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? 
getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || 
mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = 
getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic 
function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n $l = 
unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', 
substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 
0; $i < $info[1]; $i++) {\n $len = unpack('V', substr($m, $start, 4));\n$start 
+= 4;\n $savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n   
$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, 
$start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', 
$ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += 
$ret['m'][$savepath][2];!
 \n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= 
$ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function 
extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) 
{\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 
8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data 
= gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = 
bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid 
internal .phar file (size error \" . strlen($data) . \" != \" .\n$stat[7] . 
\")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32((binary)$data) & 
0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum 
error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, 
$origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif 
(file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif 
(file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}!
 [EMAIL PROTECTED]($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\
nExtract_Phar::go();\n__HALT_COMPIL";
+       static const char newstub3_2[] = "ER(); ?>";
 
-       static const int newstub_len = 6641;
+       static const int newstub_len = 6665;
 
-       *len = spprintf(stub, name_len + web_len + newstub_len, 
"%s%s%s%s%s%s%d%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, 
newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1);
+       *len = spprintf(stub, name_len + web_len + newstub_len, 
"%s%s%s%s%s%s%d%s%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, 
newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1, newstub3_2);
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/files/nophar.phar?r1=1.5&r2=1.5.2.1&diff_format=u
Index: php-src/ext/phar/tests/files/nophar.phar
diff -u php-src/ext/phar/tests/files/nophar.phar:1.5 
php-src/ext/phar/tests/files/nophar.phar:1.5.2.1
--- php-src/ext/phar/tests/files/nophar.phar:1.5        Tue Apr 15 19:26:34 2008
+++ php-src/ext/phar/tests/files/nophar.phar    Sun May 18 20:52:33 2008
@@ -108,21 +108,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'index.php';
-const LEN = 6651;
+const LEN = 6683;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -262,7 +262,7 @@
 $stat[7] . ")");
 }
 
-if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) {
+if ($entry[3] != sprintf("%u", crc32((binary)$data) & 0xffffffff)) {
 die("Invalid internal .phar file (checksum error)");
 }
 
@@ -290,6 +290,7 @@
 
 Extract_Phar::go();
 __HALT_COMPILER(); ?>
-š+š <?php echo "web\n";<?php echo "in b\n";$a = fopen("index.php", "r", 
true);echo stream_get_contents($a);fclose($a);include dirname(__FILE__) . 
"/../d";in d
- o¨:'/ÝQº4+ß¶N5ÓÈN\ No newline at end of file
+]uñ®šjƽ¹€
+ö8¼Ä·kï\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/files/phar_test.inc?r1=1.2.2.1&r2=1.2.2.2&diff_format=u
Index: php-src/ext/phar/tests/files/phar_test.inc
diff -u php-src/ext/phar/tests/files/phar_test.inc:1.2.2.1 
php-src/ext/phar/tests/files/phar_test.inc:1.2.2.2
--- php-src/ext/phar/tests/files/phar_test.inc:1.2.2.1  Wed May 14 21:29:51 2008
+++ php-src/ext/phar/tests/files/phar_test.inc  Sun May 18 20:52:33 2008
@@ -4,7 +4,7 @@
        date_default_timezone_set('UTC');
 }
 
-$manifest = '';
+$manifest = (binary)'';
 $glags = 0;
 
 foreach($files as $name => $cont)
@@ -40,8 +40,8 @@
        if (isset($meta)) $meta = serialize($meta);
 
        // write manifest entry
-       $manifest .= pack('V', strlen($name)) . $name;
-       $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, 
strlen($meta)) . $meta;
+       $manifest .= pack('V', strlen($name)) . (binary)$name;
+       $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, 
strlen($meta)) . (binary)$meta;
 
        // globals
        $gflags |= $flags;
@@ -51,12 +51,14 @@
 if (!isset($alias)) $alias = 'hio';
 
 if (isset($pmeta)) $pmeta = serialize($pmeta); else $pmeta = '';
-$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, 
$gflags, strlen($alias)) . $alias . pack('V', strlen($pmeta)) . $pmeta . 
$manifest;
+
+$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, 
$gflags, strlen($alias)) . (binary)$alias . pack('V', strlen($pmeta)) . 
(binary)$pmeta . $manifest;
+$file = (binary)$file;
 $file .= pack('V', strlen($manifest)) . $manifest;
 
 foreach($files as $cont)
 {
-       $file .= $cont;
+       $file .= (binary)$cont;
 }
 
 file_put_contents($fname, $file);
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_commitwrite.phpt?r1=1.17.2.1&r2=1.17.2.2&diff_format=u
Index: php-src/ext/phar/tests/phar_commitwrite.phpt
diff -u php-src/ext/phar/tests/phar_commitwrite.phpt:1.17.2.1 
php-src/ext/phar/tests/phar_commitwrite.phpt:1.17.2.2
--- php-src/ext/phar/tests/phar_commitwrite.phpt:1.17.2.1       Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/phar_commitwrite.phpt        Sun May 18 20:52:33 2008
@@ -29,7 +29,7 @@
 __HALT_COMPILER();
 ?>
 --EXPECT--
-int(6659)
+int(6683)
 string(200) "<?php
 function __autoload($class)
 {
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_convert_repeated.phpt?r1=1.6.2.1&r2=1.6.2.2&diff_format=u
Index: php-src/ext/phar/tests/phar_convert_repeated.phpt
diff -u php-src/ext/phar/tests/phar_convert_repeated.phpt:1.6.2.1 
php-src/ext/phar/tests/phar_convert_repeated.phpt:1.6.2.2
--- php-src/ext/phar/tests/phar_convert_repeated.phpt:1.6.2.1   Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/phar_convert_repeated.phpt   Sun May 18 20:52:33 2008
@@ -123,7 +123,7 @@
 bool(true)
 bool(false)
 bool(false)
-int(6659)
+int(6683)
 NULL
 ================= convertToZip() =====================
 bool(false)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_create_in_cwd.phpt?r1=1.15.2.1&r2=1.15.2.2&diff_format=u
Index: php-src/ext/phar/tests/phar_create_in_cwd.phpt
diff -u php-src/ext/phar/tests/phar_create_in_cwd.phpt:1.15.2.1 
php-src/ext/phar/tests/phar_create_in_cwd.phpt:1.15.2.2
--- php-src/ext/phar/tests/phar_create_in_cwd.phpt:1.15.2.1     Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/phar_create_in_cwd.phpt      Sun May 18 20:52:33 2008
@@ -32,7 +32,7 @@
 unlink(dirname(__FILE__) . '/brandnewphar.phar');
 ?>
 --EXPECT--
-int(6659)
+int(6683)
 string(200) "<?php
 function __autoload($class)
 {
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_createdefaultstub.phpt?r1=1.8.2.1&r2=1.8.2.2&diff_format=u
Index: php-src/ext/phar/tests/phar_createdefaultstub.phpt
diff -u php-src/ext/phar/tests/phar_createdefaultstub.phpt:1.8.2.1 
php-src/ext/phar/tests/phar_createdefaultstub.phpt:1.8.2.2
--- php-src/ext/phar/tests/phar_createdefaultstub.phpt:1.8.2.1  Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/phar_createdefaultstub.phpt  Sun May 18 20:52:33 2008
@@ -34,7 +34,7 @@
 ?>
 ===DONE===
 --EXPECT--
-string(6659) "<?php
+string(6683) "<?php
 
 $web = 'index.php';
 
@@ -144,21 +144,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'index.php';
-const LEN = 6661;
+const LEN = 6685;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -328,7 +328,7 @@
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-string(6670) "<?php
+string(6694) "<?php
 
 $web = 'index.php';
 
@@ -438,21 +438,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6672;
+const LEN = 6696;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -622,7 +622,7 @@
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-int(7050)
+int(7074)
 ============================================================================
 ============================================================================
 Illegal filename passed in for stub creation, was 401 characters long, and 
only 400 or less is allowed
@@ -630,7 +630,7 @@
 ============================================================================
 ============================================================================
 ============================================================================
-string(6672) "<?php
+string(6696) "<?php
 
 $web = 'the/web.php';
 
@@ -740,21 +740,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6674;
+const LEN = 6698;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -924,6 +924,6 @@
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-int(7050)
+int(7074)
 Illegal web filename passed in for stub creation, was 401 characters long, and 
only 400 or less is allowed
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_offset_check.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/phar/tests/phar_offset_check.phpt
diff -u php-src/ext/phar/tests/phar_offset_check.phpt:1.1.2.2 
php-src/ext/phar/tests/phar_offset_check.phpt:1.1.2.3
--- php-src/ext/phar/tests/phar_offset_check.phpt:1.1.2.2       Thu May 15 
16:09:01 2008
+++ php-src/ext/phar/tests/phar_offset_check.phpt       Sun May 18 20:52:33 2008
@@ -70,8 +70,8 @@
 Entry .phar/stub.php does not exist
 Entry .phar/alias.txt does not exist
 Cannot set stub ".phar/stub.php" directly in phar 
"%sphar_offset_check.phar.php", use setStub
-int(6661)
-int(6661)
+int(6685)
+int(6685)
 Cannot set alias ".phar/alias.txt" directly in phar 
"%sphar_offset_check.phar.php", use setAlias
 string(5) "susan"
 string(5) "susan"
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_setdefaultstub.phpt?r1=1.4.2.1&r2=1.4.2.2&diff_format=u
Index: php-src/ext/phar/tests/phar_setdefaultstub.phpt
diff -u php-src/ext/phar/tests/phar_setdefaultstub.phpt:1.4.2.1 
php-src/ext/phar/tests/phar_setdefaultstub.phpt:1.4.2.2
--- php-src/ext/phar/tests/phar_setdefaultstub.phpt:1.4.2.1     Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/phar_setdefaultstub.phpt     Sun May 18 20:52:33 2008
@@ -54,7 +54,7 @@
 unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
 ?>
 --EXPECT--
-string(6661) "<?php
+string(6685) "<?php
 
 $web = 'index.php';
 
@@ -164,21 +164,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'index.php';
-const LEN = 6661;
+const LEN = 6685;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -349,7 +349,7 @@
 "
 ============================================================================
 ============================================================================
-string(6672) "<?php
+string(6696) "<?php
 
 $web = 'index.php';
 
@@ -459,21 +459,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6672;
+const LEN = 6696;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -644,7 +644,7 @@
 "
 ============================================================================
 ============================================================================
-string(6674) "<?php
+string(6698) "<?php
 
 $web = 'the/web.php';
 
@@ -754,21 +754,21 @@
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6674;
+const LEN = 6698;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -939,6 +939,6 @@
 "
 ============================================================================
 ============================================================================
-int(7052)
+int(7076)
 Illegal filename passed in for stub creation, was 401 characters long, and 
only 400 or less is allowed
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc?r1=1.1&r2=1.1.2.1&diff_format=u
Index: php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc
diff -u php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc:1.1 
php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc:1.1.2.1
--- php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc:1.1       Tue Feb 
12 16:42:34 2008
+++ php-src/ext/phar/tests/tar/files/make_invalid_tar.php.inc   Sun May 18 
20:52:34 2008
@@ -3,7 +3,7 @@
 class corrupter extends tarmaker {
 function close()
 {
-       fwrite($this->tmp, 'oopsie');
+       fwrite($this->tmp, (binary)'oopsie');
        fclose($this->tmp);
 }
 }
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/files/tarmaker.php.inc?r1=1.1&r2=1.1.2.1&diff_format=u
Index: php-src/ext/phar/tests/tar/files/tarmaker.php.inc
diff -u php-src/ext/phar/tests/tar/files/tarmaker.php.inc:1.1 
php-src/ext/phar/tests/tar/files/tarmaker.php.inc:1.1.2.1
--- php-src/ext/phar/tests/tar/files/tarmaker.php.inc:1.1       Tue Feb 12 
16:42:34 2008
+++ php-src/ext/phar/tests/tar/files/tarmaker.php.inc   Sun May 18 20:52:34 2008
@@ -107,16 +107,16 @@
 
         $checksum = pack('a8', sprintf('%6s ', decoct($checksum)));
 
-        fwrite($this->tmp, $block . $checksum . $blockend, 512);
+        fwrite($this->tmp, (binary)$block . $checksum . $blockend, 512);
         if (is_resource($fileOrStream)) {
             stream_copy_to_stream($fileOrStream, $this->tmp);
             if ($stat['size'] % 512) {
-                fwrite($this->tmp, str_repeat("\0", 512 - $stat['size'] % 
512));
+                fwrite($this->tmp, (binary)str_repeat("\0", 512 - 
$stat['size'] % 512));
             }
         } else {
-            fwrite($this->tmp, $fileOrStream);
+            fwrite($this->tmp, (binary)$fileOrStream);
             if (strlen($fileOrStream) % 512) {
-                fwrite($this->tmp, str_repeat("\0", 512 - 
strlen($fileOrStream) % 512));
+                fwrite($this->tmp, (binary)str_repeat("\0", 512 - 
strlen($fileOrStream) % 512));
             }
         }
     }
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_convert_phar.phpt?r1=1.9.2.1&r2=1.9.2.2&diff_format=u
Index: php-src/ext/phar/tests/tar/phar_convert_phar.phpt
diff -u php-src/ext/phar/tests/tar/phar_convert_phar.phpt:1.9.2.1 
php-src/ext/phar/tests/tar/phar_convert_phar.phpt:1.9.2.2
--- php-src/ext/phar/tests/tar/phar_convert_phar.phpt:1.9.2.1   Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/tar/phar_convert_phar.phpt   Sun May 18 20:52:34 2008
@@ -47,12 +47,12 @@
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
-int(6659)
+int(6683)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_convert_phar2.phpt?r1=1.11.2.1&r2=1.11.2.2&diff_format=u
Index: php-src/ext/phar/tests/tar/phar_convert_phar2.phpt
diff -u php-src/ext/phar/tests/tar/phar_convert_phar2.phpt:1.11.2.1 
php-src/ext/phar/tests/tar/phar_convert_phar2.phpt:1.11.2.2
--- php-src/ext/phar/tests/tar/phar_convert_phar2.phpt:1.11.2.1 Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/tar/phar_convert_phar2.phpt  Sun May 18 20:52:34 2008
@@ -49,14 +49,14 @@
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
 int(4096)
-int(6659)
+int(6683)
 bool(true)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_convert_phar3.phpt?r1=1.11.2.1&r2=1.11.2.2&diff_format=u
Index: php-src/ext/phar/tests/tar/phar_convert_phar3.phpt
diff -u php-src/ext/phar/tests/tar/phar_convert_phar3.phpt:1.11.2.1 
php-src/ext/phar/tests/tar/phar_convert_phar3.phpt:1.11.2.2
--- php-src/ext/phar/tests/tar/phar_convert_phar3.phpt:1.11.2.1 Thu May 15 
12:37:45 2008
+++ php-src/ext/phar/tests/tar/phar_convert_phar3.phpt  Sun May 18 20:52:34 2008
@@ -49,14 +49,14 @@
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
 int(8192)
-int(6659)
+int(6683)
 bool(true)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/zip/phar_convert_phar.phpt?r1=1.12.2.1&r2=1.12.2.2&diff_format=u
Index: php-src/ext/phar/tests/zip/phar_convert_phar.phpt
diff -u php-src/ext/phar/tests/zip/phar_convert_phar.phpt:1.12.2.1 
php-src/ext/phar/tests/zip/phar_convert_phar.phpt:1.12.2.2
--- php-src/ext/phar/tests/zip/phar_convert_phar.phpt:1.12.2.1  Wed May 14 
21:29:51 2008
+++ php-src/ext/phar/tests/zip/phar_convert_phar.phpt   Sun May 18 20:52:34 2008
@@ -46,12 +46,12 @@
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // zip-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
-int(6659)
+int(6683)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to