From: Steph Fox Date: Mon, 19 May 2008 19:05:42 +0000 (+0000) Subject: - IS_UNICODE checks and conversions X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1723 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f08aea109bc0704bae93f35b7b94e1021c669523;p=php - IS_UNICODE checks and conversions - stub and creation file updates - far too many test updates to think about --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index a8805ab2b2..f910ec5f2b 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -635,7 +635,12 @@ PHP_METHOD(Phar, webPhar) return; } switch (Z_TYPE_P(retval_ptr)) { - case IS_STRING : +#if PHP_VERSION_ID >= 60000 + case IS_UNICODE: + zval_unicode_to_string(retval_ptr TSRMLS_CC); + /* break intentionally omitted */ +#endif + case IS_STRING: efree(entry); if (fci.retval_ptr_ptr != &retval_ptr) { entry = estrndup(Z_STRVAL_PP(fci.retval_ptr_ptr), Z_STRLEN_PP(fci.retval_ptr_ptr)); @@ -831,7 +836,12 @@ PHP_METHOD(Phar, webPhar) RETURN_FALSE; } break; - case IS_STRING : +#if PHP_VERSION_ID >= 60000 + case IS_UNICODE: + zval_unicode_to_string(*(val) TSRMLS_CC); + /* break intentionally omitted */ +#endif + case IS_STRING: PHAR_SET_USER_MIME(PHAR_MIME_OTHER) break; default : @@ -884,10 +894,18 @@ PHP_METHOD(Phar, mungServer) zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to retrieve array value in Phar::mungServer()"); return; } + +#if PHP_VERSION_ID >= 60000 + if (Z_TYPE_PP(data) == IS_UNICODE) { + zval_unicode_to_string(*(data) TSRMLS_CC); + } +#endif + if (Z_TYPE_PP(data) != IS_STRING) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME"); return; } + if (!php_self && Z_STRLEN_PP(data) == sizeof("PHP_SELF")-1 && !strncmp(Z_STRVAL_PP(data), "PHP_SELF", sizeof("PHP_SELF")-1)) { if (SUCCESS != zend_hash_add_empty_element(&(PHAR_GLOBALS->phar_SERVER_mung_list), "PHP_SELF", sizeof("PHP_SELF")-1)) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unable to add PHP_SELF to Phar::mungServer() list of values to mung"); @@ -1340,16 +1358,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ } if (!value) { /* failure in get_current_data */ - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned no value", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned no value", ce->name); return ZEND_HASH_APPLY_STOP; } switch (Z_TYPE_PP(value)) { - case IS_STRING : +#if PHP_VERSION_ID >= 60000 + case IS_UNICODE: + zval_unicode_to_string(*(value) TSRMLS_CC); + /* break intentionally omitted */ +#endif + case IS_STRING: break; - case IS_RESOURCE : + case IS_RESOURCE: php_stream_from_zval_no_verify(fp, value); if (!fp) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returned an invalid stream handle", ce->name); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returned an invalid stream handle", ce->name); return ZEND_HASH_APPLY_STOP; } if (iter->funcs->get_current_key) { @@ -1359,29 +1382,28 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ return ZEND_HASH_APPLY_STOP; } - PHAR_STR(key, str_key); - if (key_type == HASH_KEY_IS_LONG) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } + PHAR_STR(key, str_key); save = str_key; if (str_key[str_key_len - 1] == '\0') str_key_len--; } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } close_fp = 0; opened = (char *) estrndup(str, sizeof("[stream]") + 1); goto after_open_fp; - case IS_OBJECT : + case IS_OBJECT: if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) { char *test = NULL; zval dummy; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(*value TSRMLS_CC); if (!base_len) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ce->name); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name); return ZEND_HASH_APPLY_STOP; } switch (intern->type) { @@ -1411,7 +1433,11 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ goto phar_spl_fileinfo; case SPL_FS_INFO: case SPL_FS_FILE: +#if PHP_VERSION_ID >= 60000 fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC); +#else + fname = expand_filepath(intern->file_name, NULL TSRMLS_CC); +#endif fname_len = strlen(fname); save = fname; is_splfileinfo = 1; @@ -1420,7 +1446,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ } /* fall-through */ default : - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid value (must return a string)", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid value (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1447,7 +1473,7 @@ phar_spl_fileinfo: str_key_len--; } } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base); if (save) { efree(save); efree(temp); @@ -1462,22 +1488,21 @@ phar_spl_fileinfo: return ZEND_HASH_APPLY_STOP; } - PHAR_STR(key, str_key); - if (key_type == HASH_KEY_IS_LONG) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } + PHAR_STR(key, str_key); save = str_key; if (str_key[str_key_len - 1] == '\0') str_key_len--; } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } } #if PHP_MAJOR_VERSION < 6 if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that safe mode prevents opening", ce->name, fname); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name, fname); if (save) { efree(save); } @@ -1489,7 +1514,7 @@ phar_spl_fileinfo: #endif if (php_check_open_basedir(fname TSRMLS_CC)) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that open_basedir prevents opening", ce->name, fname); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name, fname); if (save) { efree(save); } @@ -1502,7 +1527,7 @@ phar_spl_fileinfo: /* try to open source file, then create internal phar file and copy contents */ fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened); if (!fp) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a file that could not be opened \"%s\"", ce->name, fname); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a file that could not be opened \"%s\"", ce->name, fname); if (save) { efree(save); } @@ -3789,6 +3814,11 @@ PHP_METHOD(Phar, extractTo) switch (Z_TYPE_P(zval_files)) { case IS_NULL: goto all_files; +#if PHP_VERSION_ID >= 60000 + case IS_UNICODE: + zval_unicode_to_string(zval_files TSRMLS_CC); + /* break intentionally omitted */ +#endif case IS_STRING: filename = Z_STRVAL_P(zval_files); filename_len = Z_STRLEN_P(zval_files); @@ -3802,6 +3832,11 @@ PHP_METHOD(Phar, extractTo) zval **zval_file; if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) { switch (Z_TYPE_PP(zval_file)) { +#if PHP_VERSION_ID >= 60000 + case IS_UNICODE: + zval_unicode_to_string(*(zval_file) TSRMLS_CC); + /* break intentionally omitted */ +#endif case IS_STRING: break; default: diff --git a/ext/phar/shortarc.php b/ext/phar/shortarc.php index 748afeda2e..1bf3baa8aa 100644 --- a/ext/phar/shortarc.php +++ b/ext/phar/shortarc.php @@ -114,15 +114,15 @@ class Extract_Phar { $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]); diff --git a/ext/phar/stub.h b/ext/phar/stub.h index 104a8baa63..2a1cbe6c09 100644 --- a/ext/phar/stub.h +++ b/ext/phar/stub.h @@ -24,10 +24,11 @@ static inline void phar_get_stub(const char *index_php, const char *web, size_t 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 \"\\n \\n 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_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();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude 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());\n}\n}\n}\n\n@rmdir($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();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($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}\n}\n}\n\n@rmdir($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); } diff --git a/ext/phar/tests/008.phpt b/ext/phar/tests/008.phpt index 664ffea5cb..366a4c6d6d 100644 --- a/ext/phar/tests/008.phpt +++ b/ext/phar/tests/008.phpt @@ -4,10 +4,10 @@ Phar::mapPhar truncated manifest (not enough for manifest length) <?php if (!extension_loaded("phar")) die("skip");?> --FILE-- <?php -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; -$file .= pack('V', 500) . 'notenough'; +$file .= pack('V', 500) . (binary)'notenough'; file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file); try { include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; diff --git a/ext/phar/tests/009.phpt b/ext/phar/tests/009.phpt index c80445d61b..42bdf1d1e7 100644 --- a/ext/phar/tests/009.phpt +++ b/ext/phar/tests/009.phpt @@ -6,10 +6,10 @@ Phar::mapPhar too many manifest entries phar.require_hash=0 --FILE-- <?php -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; -$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . str_repeat('A', 500); +$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . (binary)str_repeat('A', 500); file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file); try { include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; diff --git a/ext/phar/tests/010.phpt b/ext/phar/tests/010.phpt index bfeb435362..aff6d694d9 100644 --- a/ext/phar/tests/010.phpt +++ b/ext/phar/tests/010.phpt @@ -6,14 +6,14 @@ Phar::mapPhar buffer overrun phar.require_hash=0 --FILE-- <?php -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; // this fails because the manifest length does not include the other 10 byte manifest data -$manifest = pack('V', 1) . 'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0); -$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . 'hio' . pack('V', 0) . $manifest; +$manifest = pack('V', 1) . (binary)'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0); +$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . (binary)'hio' . pack('V', 0) . (binary)$manifest; file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file); try { diff --git a/ext/phar/tests/011.phpt b/ext/phar/tests/011.phpt index 8e76bdce15..a0f5b2d849 100644 --- a/ext/phar/tests/011.phpt +++ b/ext/phar/tests/011.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/012.phpt b/ext/phar/tests/012.phpt index 3246eff468..f079d77c8f 100644 --- a/ext/phar/tests/012.phpt +++ b/ext/phar/tests/012.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/013.phpt b/ext/phar/tests/013.phpt index ae3ae72936..02c53b802f 100644 --- a/ext/phar/tests/013.phpt +++ b/ext/phar/tests/013.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; // filesize should be 1, and is 2 $files = array(); diff --git a/ext/phar/tests/014.phpt b/ext/phar/tests/014.phpt index 1a20086ffa..7866c08af2 100644 --- a/ext/phar/tests/014.phpt +++ b/ext/phar/tests/014.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; // wrong crc32 $files = array(); diff --git a/ext/phar/tests/015.phpt b/ext/phar/tests/015.phpt index b93b77e9fb..a8425205fa 100644 --- a/ext/phar/tests/015.phpt +++ b/ext/phar/tests/015.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont'=>'a','comp'=>chr(75) . chr(4) . chr(0) /* 'a' gzdeflated */, 'flags'=>0x00001000); diff --git a/ext/phar/tests/015b.phpt b/ext/phar/tests/015b.phpt index 08ead2d9c0..e2578bf649 100755 --- a/ext/phar/tests/015b.phpt +++ b/ext/phar/tests/015b.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont'=>'Hello World', 'comp'=>pack('H*', '425a6834314159265359065c89da0000009780400000400080060490002000310c082031a916c41d41e2ee48a70a1200cb913b40'),'flags'=>0x00002000); diff --git a/ext/phar/tests/016.phpt b/ext/phar/tests/016.phpt index 302d06d3cb..7fbcb80e07 100644 --- a/ext/phar/tests/016.phpt +++ b/ext/phar/tests/016.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; // file length is too short $files = array(); diff --git a/ext/phar/tests/016b.phpt b/ext/phar/tests/016b.phpt index 8fe66826d6..e387688314 100755 --- a/ext/phar/tests/016b.phpt +++ b/ext/phar/tests/016b.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; // file length is too short $files = array(); diff --git a/ext/phar/tests/017.phpt b/ext/phar/tests/017.phpt index ec012eaa11..0915708ebc 100644 --- a/ext/phar/tests/017.phpt +++ b/ext/phar/tests/017.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/018.phpt b/ext/phar/tests/018.phpt index 97cd323779..320356fd4d 100644 --- a/ext/phar/tests/018.phpt +++ b/ext/phar/tests/018.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; @@ -19,10 +19,12 @@ include 'files/phar_test.inc'; include $fname; $dir = opendir('phar://hio/'); + while (false !== ($a = readdir($dir))) { var_dump($a); var_dump(is_dir('phar://hio/' . $a)); } + ?> --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> diff --git a/ext/phar/tests/019.phpt b/ext/phar/tests/019.phpt index 3d00b5f8e9..f9cff347ef 100644 --- a/ext/phar/tests/019.phpt +++ b/ext/phar/tests/019.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/019b.phpt b/ext/phar/tests/019b.phpt index 574919b793..e3d1f7672d 100755 --- a/ext/phar/tests/019b.phpt +++ b/ext/phar/tests/019b.phpt @@ -2,13 +2,14 @@ Phar: opendir test, recurse into --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> +<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?> --INI-- phar.require_hash=0 --FILE-- <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/019c.phpt b/ext/phar/tests/019c.phpt index 242b666871..ed5527e1c3 100755 --- a/ext/phar/tests/019c.phpt +++ b/ext/phar/tests/019c.phpt @@ -2,13 +2,14 @@ Phar: opendir test, recurse into --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> +<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?> --INI-- phar.require_hash=0 --FILE-- <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/020.phpt b/ext/phar/tests/020.phpt index b06cdbf731..4587d5210b 100644 --- a/ext/phar/tests/020.phpt +++ b/ext/phar/tests/020.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; @@ -53,31 +53,31 @@ array(26) { int(-1) [12]=> int(-1) - ["dev"]=> + [u"dev"]=> int(12) - ["ino"]=> + [u"ino"]=> int(%d) - ["mode"]=> + [u"mode"]=> int(33060) - ["nlink"]=> + [u"nlink"]=> int(1) - ["uid"]=> + [u"uid"]=> int(0) - ["gid"]=> + [u"gid"]=> int(0) - ["rdev"]=> + [u"rdev"]=> int(-1) - ["size"]=> + [u"size"]=> int(1) - ["atime"]=> + [u"atime"]=> int(%d) - ["mtime"]=> + [u"mtime"]=> int(%d) - ["ctime"]=> + [u"ctime"]=> int(%d) - ["blksize"]=> + [u"blksize"]=> int(-1) - ["blocks"]=> + [u"blocks"]=> int(-1) } array(26) { @@ -107,30 +107,30 @@ array(26) { int(-1) [12]=> int(-1) - ["dev"]=> + [u"dev"]=> int(12) - ["ino"]=> + [u"ino"]=> int(%d) - ["mode"]=> + [u"mode"]=> int(16749) - ["nlink"]=> + [u"nlink"]=> int(1) - ["uid"]=> + [u"uid"]=> int(0) - ["gid"]=> + [u"gid"]=> int(0) - ["rdev"]=> + [u"rdev"]=> int(-1) - ["size"]=> + [u"size"]=> int(0) - ["atime"]=> + [u"atime"]=> int(%d) - ["mtime"]=> + [u"mtime"]=> int(%d) - ["ctime"]=> + [u"ctime"]=> int(%d) - ["blksize"]=> + [u"blksize"]=> int(-1) - ["blocks"]=> + [u"blocks"]=> int(-1) } \ No newline at end of file diff --git a/ext/phar/tests/021.phpt b/ext/phar/tests/021.phpt index 9c9cd97568..a0d74fb2fe 100644 --- a/ext/phar/tests/021.phpt +++ b/ext/phar/tests/021.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; @@ -56,30 +56,30 @@ array(26) { int(-1) [12]=> int(-1) - ["dev"]=> + [u"dev"]=> int(12) - ["ino"]=> + [u"ino"]=> int(%d) - ["mode"]=> + [u"mode"]=> int(33060) - ["nlink"]=> + [u"nlink"]=> int(1) - ["uid"]=> + [u"uid"]=> int(0) - ["gid"]=> + [u"gid"]=> int(0) - ["rdev"]=> + [u"rdev"]=> int(-1) - ["size"]=> + [u"size"]=> int(1) - ["atime"]=> + [u"atime"]=> int(%d) - ["mtime"]=> + [u"mtime"]=> int(%d) - ["ctime"]=> + [u"ctime"]=> int(%d) - ["blksize"]=> + [u"blksize"]=> int(-1) - ["blocks"]=> + [u"blocks"]=> int(-1) -} \ No newline at end of file +} diff --git a/ext/phar/tests/022.phpt b/ext/phar/tests/022.phpt index 20c24a0214..4c02d6342c 100644 --- a/ext/phar/tests/022.phpt +++ b/ext/phar/tests/022.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/023.phpt b/ext/phar/tests/023.phpt index 808f91deae..205b1ed57c 100755 --- a/ext/phar/tests/023.phpt +++ b/ext/phar/tests/023.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/024.phpt b/ext/phar/tests/024.phpt index ad30d2644d..3bf0b5f008 100755 --- a/ext/phar/tests/024.phpt +++ b/ext/phar/tests/024.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/025.phpt b/ext/phar/tests/025.phpt index bbb5bc4e83..8ad434a5c4 100755 --- a/ext/phar/tests/025.phpt +++ b/ext/phar/tests/025.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/026.phpt b/ext/phar/tests/026.phpt index 696fbcf415..16a4d87554 100755 --- a/ext/phar/tests/026.phpt +++ b/ext/phar/tests/026.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; require \''.$pname.'/b.php\'; ?>'; diff --git a/ext/phar/tests/027.phpt b/ext/phar/tests/027.phpt index 679fefc2cd..0bc36f4f6d 100755 --- a/ext/phar/tests/027.phpt +++ b/ext/phar/tests/027.phpt @@ -2,13 +2,14 @@ Phar: phar:// opendir --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> +<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?> --INI-- phar.require_hash=0 --FILE-- <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; require \''.$pname.'/b.php\'; ?>'; diff --git a/ext/phar/tests/028.phpt b/ext/phar/tests/028.phpt index 087f822777..a49e938942 100755 --- a/ext/phar/tests/028.phpt +++ b/ext/phar/tests/028.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://hio'; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $alias = ''; $files = array(); diff --git a/ext/phar/tests/029.phpt b/ext/phar/tests/029.phpt index 41fcec03e7..4005e94096 100755 --- a/ext/phar/tests/029.phpt +++ b/ext/phar/tests/029.phpt @@ -11,7 +11,7 @@ $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php'; $fname = $fname1; $alias = ''; $pname = 'phar://hio'; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>'; diff --git a/ext/phar/tests/030.phpt b/ext/phar/tests/030.phpt index e1e94dba80..806da2c51e 100755 --- a/ext/phar/tests/030.phpt +++ b/ext/phar/tests/030.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; include \''.$pname.'/b.php\'; ?>'; diff --git a/ext/phar/tests/033.phpt b/ext/phar/tests/033.phpt index d53c7f52fa..5536c4d3c1 100644 --- a/ext/phar/tests/033.phpt +++ b/ext/phar/tests/033.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php'; $pname = 'phar://hio'; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>'; diff --git a/ext/phar/tests/033a.phpt b/ext/phar/tests/033a.phpt index e8725bdda6..13067b4506 100644 --- a/ext/phar/tests/033a.phpt +++ b/ext/phar/tests/033a.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php'; $pname = 'phar://hio'; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>'; diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index c644424d25..9d331652f7 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -134,35 +134,35 @@ echo $e->getMessage() . "\n"; ?> ===DONE=== --EXPECTF-- -Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d +Warning: Phar::mungServer() expects parameter 1 to be array, Unicode string given in %sbadparameters.php on line %d -Warning: Phar::createDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::createDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d -Warning: Phar::loadPhar() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::loadPhar() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d -Warning: Phar::canCompress() expects parameter 1 to be long, string given in %sbadparameters.php on line %d +Warning: Phar::canCompress() expects parameter 1 to be long, Unicode string given in %sbadparameters.php on line %d -Warning: Phar::__construct() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::__construct() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Warning: Phar::convertToExecutable() expects parameter 1 to be long, array given in %sbadparameters.php on line %d Warning: Phar::convertToData() expects parameter 1 to be long, array given in %sbadparameters.php on line %d -Warning: PharData::delete() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: PharData::delete() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Cannot write out phar archive, phar is read-only Entry oops does not exist and cannot be deleted %sfiles/frontcontroller10.phar Cannot write out phar archive, phar is read-only A Phar alias cannot be set in a plain tar archive -Warning: Phar::setAlias() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::setAlias() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Cannot change stub, phar is read-only A Phar stub cannot be set in a plain tar archive -Warning: Phar::setStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::setStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d A Phar stub cannot be set in a plain tar archive -Warning: Phar::setDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::setDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Cannot change stub: phar.readonly=1 Cannot set signature algorithm, phar is read-only Cannot set signature algorithm, not possible with tar-based phar archives @@ -177,18 +177,18 @@ Phar is readonly, cannot change compression Warning: Phar::copy() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d Cannot copy "a" to "b", phar is read-only -Warning: Phar::offsetExists() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::offsetExists() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d -Warning: Phar::offsetGet() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::offsetGet() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Warning: Phar::offsetSet() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d -Warning: PharData::offsetUnset() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: PharData::offsetUnset() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Write operations disabled by INI setting -Warning: Phar::addEmptyDir() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::addEmptyDir() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d -Warning: Phar::addFile() expects parameter 1 to be string, array given in %sbadparameters.php on line %d +Warning: Phar::addFile() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d Warning: Phar::addFromString() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d Write operations disabled by INI setting diff --git a/ext/phar/tests/delete.phpt b/ext/phar/tests/delete.phpt index 1d98509064..6c97898dfd 100644 --- a/ext/phar/tests/delete.phpt +++ b/ext/phar/tests/delete.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/delete_in_phar.phpt b/ext/phar/tests/delete_in_phar.phpt index 4842d27913..adbb95ef7a 100644 --- a/ext/phar/tests/delete_in_phar.phpt +++ b/ext/phar/tests/delete_in_phar.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/delete_in_phar_b.phpt b/ext/phar/tests/delete_in_phar_b.phpt index d26f51cbf1..97ee4a12ae 100755 --- a/ext/phar/tests/delete_in_phar_b.phpt +++ b/ext/phar/tests/delete_in_phar_b.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/delete_in_phar_confirm.phpt b/ext/phar/tests/delete_in_phar_confirm.phpt index 13a8d0db29..360b79a875 100644 --- a/ext/phar/tests/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/delete_in_phar_confirm.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; diff --git a/ext/phar/tests/dir.phpt b/ext/phar/tests/dir.phpt index a8f9d3f889..716d5f7846 100644 --- a/ext/phar/tests/dir.phpt +++ b/ext/phar/tests/dir.phpt @@ -37,7 +37,7 @@ mkdir('phar://' . dirname(__FILE__) . '/ok.phar/fails'); file_put_contents('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt', 'hi'); mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub'); mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt'); -file_put_contents(dirname(__FILE__) . '/oops.phar', '<?php this should screw em up __HALT_COMPILER();'); +file_put_contents(dirname(__FILE__) . '/oops.phar', (binary)'<?php this should screw em up __HALT_COMPILER();'); mkdir('phar://' . dirname(__FILE__) . '/oops.phar/fails'); mkdir('phar://'); @@ -72,7 +72,7 @@ Warning: mkdir(): phar error: cannot create directory "fails" in phar "%sok.phar Warning: mkdir(): phar error: cannot create directory "sub" in phar "%sok.phar", directory already exists in %sdir.php on line %d -Warning: mkdir(): phar error: cannot create directory "sub/directory.txt" in phar "%sok.phar", phar error: path "sub/directory.txt" exists and is a not a directory in %sdir.php on line %d +Warning: mkdir(): phar error: cannot create directory "sub/directory.txt" in phar "%sok.phar", phar error: path "sub/directory.txt" exists and is not a directory in %sdir.php on line %d Warning: mkdir(): internal corruption of phar "%soops.phar" (truncated manifest at stub end) in %sdir.php on line %d diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index e899604e95..68bd4725c9 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -27,7 +27,6 @@ echo file_get_contents("foob", true); echo file_get_contents("./hi", 0, $context); echo file_get_contents("../oops"); echo file_get_contents("./hi", 0, $context, 50000); -ini_set("magic_quotes_runtime", 1); echo file_get_contents("./hi"); echo file_get_contents("./hi", 0, $context, 0, 0); ?> @@ -40,7 +39,9 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: file_get_contents() expects parameter 1 to be string, array given in %sfgc_edgecases.php on line %d +Notice: Array to string conversion in %sfgc_edgecases.php on line %d + +Warning: file_get_contents(Array): failed to open stream: No such file or directory in %sfgc_edgecases.php on line %d blah <?php echo file_get_contents("foo/" . basename(__FILE__)); @@ -52,7 +53,6 @@ echo file_get_contents("foob", true); echo file_get_contents("./hi", 0, $context); echo file_get_contents("../oops"); echo file_get_contents("./hi", 0, $context, 50000); -ini_set("magic_quotes_runtime", 1); echo file_get_contents("./hi"); echo file_get_contents("./hi", 0, $context, 0, 0); ?> @@ -70,7 +70,6 @@ echo file_get_contents("foob", true); echo file_get_contents("./hi", 0, $context); echo file_get_contents("../oops"); echo file_get_contents("./hi", 0, $context, 50000); -ini_set("magic_quotes_runtime", 1); echo file_get_contents("./hi"); echo file_get_contents("./hi", 0, $context, 0, 0); ?> @@ -79,17 +78,16 @@ Warning: file_get_contents(phar://%sfgc_edgecases.phar.php/oops): failed to open Warning: file_get_contents(): Failed to seek to position 50000 in the stream in phar://%sfgc_edgecases.phar.php/foo/hi on line %d <?php -echo file_get_contents(\"foo/\" . basename(__FILE__)); +echo file_get_contents("foo/" . basename(__FILE__)); $context = stream_context_create(); -file_get_contents(\"./hi\", 0, $context, 0, -1); -echo file_get_contents(\"foob\"); -set_include_path(\"%stests\"); -echo file_get_contents(\"foob\", true); -echo file_get_contents(\"./hi\", 0, $context); -echo file_get_contents(\"../oops\"); -echo file_get_contents(\"./hi\", 0, $context, 50000); -ini_set(\"magic_quotes_runtime\", 1); -echo file_get_contents(\"./hi\"); -echo file_get_contents(\"./hi\", 0, $context, 0, 0); +file_get_contents("./hi", 0, $context, 0, -1); +echo file_get_contents("foob"); +set_include_path("%stests"); +echo file_get_contents("foob", true); +echo file_get_contents("./hi", 0, $context); +echo file_get_contents("../oops"); +echo file_get_contents("./hi", 0, $context, 50000); +echo file_get_contents("./hi"); +echo file_get_contents("./hi", 0, $context, 0, 0); ?> ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/files/nophar.phar b/ext/phar/tests/files/nophar.phar index f1c5252018..4eb3083c92 100644 Binary files a/ext/phar/tests/files/nophar.phar and b/ext/phar/tests/files/nophar.phar differ diff --git a/ext/phar/tests/files/phar_oo_test.inc b/ext/phar/tests/files/phar_oo_test.inc index 9863e8da93..e92b4444c1 100644 --- a/ext/phar/tests/files/phar_oo_test.inc +++ b/ext/phar/tests/files/phar_oo_test.inc @@ -4,7 +4,7 @@ ini_set('date.timezone', 'GMT'); $fname = dirname(__FILE__) . '/phar_oo_test.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); diff --git a/ext/phar/tests/files/phar_test.inc b/ext/phar/tests/files/phar_test.inc index 0f989f9db1..f82471d13b 100644 --- a/ext/phar/tests/files/phar_test.inc +++ b/ext/phar/tests/files/phar_test.inc @@ -4,7 +4,7 @@ if (function_exists('date_default_timezone_set')) { date_default_timezone_set('UTC'); } -$manifest = ''; +$manifest = (binary)''; $glags = 0; foreach($files as $name => $cont) @@ -40,8 +40,8 @@ foreach($files as $name => $cont) 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 @@ foreach($files as $name => $cont) 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); diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt index 3579a2c221..b8f33b40a3 100644 --- a/ext/phar/tests/fopen_edgecases2.phpt +++ b/ext/phar/tests/fopen_edgecases2.phpt @@ -35,7 +35,9 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: fopen() expects parameter 1 to be string, array given in %sfopen_edgecases2.php on line %d +Notice: Array to string conversion in %sfopen_edgecases2.php on line %d + +Warning: fopen(Array): failed to open stream: No such file or directory in %sfopen_edgecases2.php on line %d blah test diff --git a/ext/phar/tests/frontcontroller10.phpt b/ext/phar/tests/frontcontroller10.phpt index de6775fbfc..667d5c243c 100644 --- a/ext/phar/tests/frontcontroller10.phpt +++ b/ext/phar/tests/frontcontroller10.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite access denied --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller4.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 Status: 403 Access Denied --EXPECT-- <html> diff --git a/ext/phar/tests/frontcontroller11.phpt b/ext/phar/tests/frontcontroller11.phpt index 51fffbe13c..06ba425497 100644 --- a/ext/phar/tests/frontcontroller11.phpt +++ b/ext/phar/tests/frontcontroller11.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type extension is not a string --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller5.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.php:2 Stack trace: diff --git a/ext/phar/tests/frontcontroller12.phpt b/ext/phar/tests/frontcontroller12.phpt index 0c277b3a77..956ea1c050 100644 --- a/ext/phar/tests/frontcontroller12.phpt +++ b/ext/phar/tests/frontcontroller12.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type unknown int --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller6.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.php:2 Stack trace: diff --git a/ext/phar/tests/frontcontroller13.phpt b/ext/phar/tests/frontcontroller13.phpt index 669857647d..717e56996f 100644 --- a/ext/phar/tests/frontcontroller13.phpt +++ b/ext/phar/tests/frontcontroller13.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type not string/int --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller7.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.php:2 Stack trace: diff --git a/ext/phar/tests/frontcontroller15.phpt b/ext/phar/tests/frontcontroller15.phpt index daeb60954d..370098014d 100644 --- a/ext/phar/tests/frontcontroller15.phpt +++ b/ext/phar/tests/frontcontroller15.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHPS --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/frontcontroller16.phpt b/ext/phar/tests/frontcontroller16.phpt index cefb40dcfa..712af40bf3 100644 --- a/ext/phar/tests/frontcontroller16.phpt +++ b/ext/phar/tests/frontcontroller16.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHP --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio1 diff --git a/ext/phar/tests/frontcontroller2.phpt b/ext/phar/tests/frontcontroller2.phpt index 085fe1440e..d0744dea1d 100644 --- a/ext/phar/tests/frontcontroller2.phpt +++ b/ext/phar/tests/frontcontroller2.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller PHP test --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio diff --git a/ext/phar/tests/frontcontroller21.phpt b/ext/phar/tests/frontcontroller21.phpt index 8d91ccb1b2..d153520e56 100644 --- a/ext/phar/tests/frontcontroller21.phpt +++ b/ext/phar/tests/frontcontroller21.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller $_SERVER munging success --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -12,7 +12,7 @@ QUERY_STRING=test=hi --FILE_EXTERNAL-- files/frontcontroller12.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- string(10) "/index.php" string(10) "/index.php" @@ -21,4 +21,4 @@ string(18) "/index.php?test=hi" string(32) "/frontcontroller21.php/index.php" string(22) "/frontcontroller21.php" string(%d) "%sfrontcontroller21.php" -string(40) "/frontcontroller21.php/index.php?test=hi" \ No newline at end of file +string(40) "/frontcontroller21.php/index.php?test=hi" diff --git a/ext/phar/tests/frontcontroller22.phpt b/ext/phar/tests/frontcontroller22.phpt index 5a96b979da..c6b74832df 100644 --- a/ext/phar/tests/frontcontroller22.phpt +++ b/ext/phar/tests/frontcontroller22.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller include from cwd test 1 --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,10 +11,10 @@ PATH_INFO=/index.php --FILE_EXTERNAL-- files/frontcontroller13.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- -string(4) "test" -string(12) "oof/test.php" +unicode(4) "test" +unicode(12) "oof/test.php" Warning: include(./hi.php): failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d diff --git a/ext/phar/tests/frontcontroller23.phpt b/ext/phar/tests/frontcontroller23.phpt index afc4ed164f..441eb701c2 100644 --- a/ext/phar/tests/frontcontroller23.phpt +++ b/ext/phar/tests/frontcontroller23.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with generic action router test --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi/there --FILE_EXTERNAL-- files/frontcontroller14.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- string(9) "/hi/there" -string(%d) "phar://%sfrontcontroller23.php/html/index.php" \ No newline at end of file +string(%d) "phar://%sfrontcontroller23.php/html/index.php" diff --git a/ext/phar/tests/frontcontroller24.phpt b/ext/phar/tests/frontcontroller24.phpt index da4c83ce67..5d94738ae7 100644 --- a/ext/phar/tests/frontcontroller24.phpt +++ b/ext/phar/tests/frontcontroller24.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with custom 404 php script --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/unknown/file --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- -My 404 is rawesome \ No newline at end of file +My 404 is rawesome diff --git a/ext/phar/tests/frontcontroller25.phpt b/ext/phar/tests/frontcontroller25.phpt index 3bffc5d5c4..80a0844f2e 100644 --- a/ext/phar/tests/frontcontroller25.phpt +++ b/ext/phar/tests/frontcontroller25.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with extra path_info --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a1.phps/extra/stuff --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- string(42) "/frontcontroller25.php/a1.phps/extra/stuff" -string(12) "/extra/stuff" \ No newline at end of file +string(12) "/extra/stuff" diff --git a/ext/phar/tests/frontcontroller26.phpt b/ext/phar/tests/frontcontroller26.phpt index a8097b0886..7d787ddf49 100644 --- a/ext/phar/tests/frontcontroller26.phpt +++ b/ext/phar/tests/frontcontroller26.phpt @@ -11,4 +11,4 @@ files/frontcontroller8.phar --EXPECTHEADERS-- Content-type: application/octet-stream --EXPECTF-- -<?php var_dump("hi"); \ No newline at end of file +<?php var_dump("hi"); diff --git a/ext/phar/tests/frontcontroller27.phpt b/ext/phar/tests/frontcontroller27.phpt index 5eaa18c63f..21dd28d31d 100644 --- a/ext/phar/tests/frontcontroller27.phpt +++ b/ext/phar/tests/frontcontroller27.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with no extension --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/noext --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/plain +Content-type: text/plain;charset=UTF-8 --EXPECTF-- -hi \ No newline at end of file +hi diff --git a/ext/phar/tests/frontcontroller28.phpt b/ext/phar/tests/frontcontroller28.phpt index a9c3df27d3..577800885b 100644 --- a/ext/phar/tests/frontcontroller28.phpt +++ b/ext/phar/tests/frontcontroller28.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with huge file --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/bigfile.txt --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/plain +Content-type: text/plain;charset=UTF-8 --EXPECT-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/ext/phar/tests/frontcontroller29.phpt b/ext/phar/tests/frontcontroller29.phpt index 49b5a718ae..2d0f5b5c05 100644 --- a/ext/phar/tests/frontcontroller29.phpt +++ b/ext/phar/tests/frontcontroller29.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with fatal error in php file --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/fatalerror.phps --FILE_EXTERNAL-- files/frontcontroller8.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- -Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1 \ No newline at end of file +Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1 diff --git a/ext/phar/tests/frontcontroller3.phpt b/ext/phar/tests/frontcontroller3.phpt index 98ec0e96f4..ac36485837 100644 --- a/ext/phar/tests/frontcontroller3.phpt +++ b/ext/phar/tests/frontcontroller3.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller phps --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/frontcontroller30.phpt b/ext/phar/tests/frontcontroller30.phpt index de6960c244..fd6088d05a 100644 --- a/ext/phar/tests/frontcontroller30.phpt +++ b/ext/phar/tests/frontcontroller30.phpt @@ -9,4 +9,4 @@ REQUEST_URI=/huh? files/frontcontroller8.phar --EXPECTF-- oops did not run -%a \ No newline at end of file +%a diff --git a/ext/phar/tests/frontcontroller31.phpt b/ext/phar/tests/frontcontroller31.phpt index b5d6835335..a02c937b58 100644 --- a/ext/phar/tests/frontcontroller31.phpt +++ b/ext/phar/tests/frontcontroller31.phpt @@ -1,15 +1,15 @@ --TEST-- Phar front controller with invalid callback for rewrites --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- SCRIPT_NAME=/frontcontroller31.php REQUEST_URI=/frontcontroller31.php --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --FILE_EXTERNAL-- files/frontcontroller16.phar --EXPECT-- -phar error: invalid rewrite callback \ No newline at end of file +phar error: invalid rewrite callback diff --git a/ext/phar/tests/frontcontroller32.phpt b/ext/phar/tests/frontcontroller32.phpt index 61d5c6aca4..3a43cc239a 100644 --- a/ext/phar/tests/frontcontroller32.phpt +++ b/ext/phar/tests/frontcontroller32.phpt @@ -1,15 +1,15 @@ --TEST-- Phar front controller with valid callback that is not good --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- SCRIPT_NAME=/frontcontroller32.php REQUEST_URI=/frontcontroller32.php --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --FILE_EXTERNAL-- files/frontcontroller17.phar --EXPECTF-- -%ahar error: failed to call rewrite callback \ No newline at end of file +%ahar error: failed to call rewrite callback diff --git a/ext/phar/tests/frontcontroller33.phpt b/ext/phar/tests/frontcontroller33.phpt index d8750b9934..91581f43af 100644 --- a/ext/phar/tests/frontcontroller33.phpt +++ b/ext/phar/tests/frontcontroller33.phpt @@ -1,15 +1,15 @@ --TEST-- Phar front controller with valid callback that does not return any value --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- SCRIPT_NAME=/frontcontroller33.php REQUEST_URI=/frontcontroller33.php --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --FILE_EXTERNAL-- files/frontcontroller18.phar --EXPECTF-- -phar error: rewrite callback must return a string or false \ No newline at end of file +phar error: rewrite callback must return a string or false diff --git a/ext/phar/tests/frontcontroller34.phpt b/ext/phar/tests/frontcontroller34.phpt index 4e0b0cd661..34a49ded4d 100644 --- a/ext/phar/tests/frontcontroller34.phpt +++ b/ext/phar/tests/frontcontroller34.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller with cwd --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -9,7 +9,7 @@ SCRIPT_NAME=/frontcontroller34.php REQUEST_URI=/frontcontroller34.php/start/index.php PATH_INFO=/start/index.php --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --FILE_EXTERNAL-- files/frontcontroller19.phar --EXPECT-- diff --git a/ext/phar/tests/frontcontroller6.phpt b/ext/phar/tests/frontcontroller6.phpt index 1a2cc2cd23..86af8a694c 100644 --- a/ext/phar/tests/frontcontroller6.phpt +++ b/ext/phar/tests/frontcontroller6.phpt @@ -18,4 +18,4 @@ Status: 404 Not Found <body> <h1>404 - File /notfound.php Not Found</h1> </body> -</html> \ No newline at end of file +</html> diff --git a/ext/phar/tests/frontcontroller8.phpt b/ext/phar/tests/frontcontroller8.phpt index 36e3206d66..1e986661b2 100644 --- a/ext/phar/tests/frontcontroller8.phpt +++ b/ext/phar/tests/frontcontroller8.phpt @@ -18,4 +18,4 @@ Status: 404 Not Found <body> <h1>404 - File /index.php Not Found</h1> </body> -</html> \ No newline at end of file +</html> diff --git a/ext/phar/tests/frontcontroller9.phpt b/ext/phar/tests/frontcontroller9.phpt index a61644315a..c591879172 100644 --- a/ext/phar/tests/frontcontroller9.phpt +++ b/ext/phar/tests/frontcontroller9.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite array --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,9 +11,9 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller3.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> </span> -</code> \ No newline at end of file +</code> diff --git a/ext/phar/tests/include_path.phpt b/ext/phar/tests/include_path.phpt index 5f9462c260..4041ae2c20 100644 --- a/ext/phar/tests/include_path.phpt +++ b/ext/phar/tests/include_path.phpt @@ -31,4 +31,4 @@ test/file1.php Warning: include(file2.php): failed to open stream: No such file or directory in %sinclude_path.php on line %d Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/ini_set.phpt b/ext/phar/tests/ini_set.phpt index 588cd4a74b..253e0528cd 100644 --- a/ext/phar/tests/ini_set.phpt +++ b/ext/phar/tests/ini_set.phpt @@ -18,11 +18,11 @@ var_dump(ini_get('phar.readonly')); __HALT_COMPILER(); ?> --EXPECT-- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" diff --git a/ext/phar/tests/ini_set_off.phpt b/ext/phar/tests/ini_set_off.phpt index 7da07c5d8d..284644fe5f 100644 --- a/ext/phar/tests/ini_set_off.phpt +++ b/ext/phar/tests/ini_set_off.phpt @@ -53,33 +53,33 @@ var_dump(ini_get('phar.readonly')); ?> ===DONE=== --EXPECT-- -string(1) "0" -string(1) "0" -string(1) "1" -string(1) "1" +unicode(1) "0" +unicode(1) "0" +unicode(1) "1" +unicode(1) "1" bool(true) yes -string(1) "0" -string(1) "0" -string(3) "yes" -string(3) "yes" +unicode(1) "0" +unicode(1) "0" +unicode(3) "yes" +unicode(3) "yes" bool(false) on -string(1) "0" -string(1) "0" -string(2) "on" -string(2) "on" +unicode(1) "0" +unicode(1) "0" +unicode(2) "on" +unicode(2) "on" bool(false) true -string(1) "0" -string(1) "0" +unicode(1) "0" +unicode(1) "0" bool(false) -string(4) "true" -string(4) "true" +unicode(4) "true" +unicode(4) "true" 0 -string(4) "true" -string(4) "true" +unicode(4) "true" +unicode(4) "true" bool(true) -string(1) "0" -string(1) "0" +unicode(1) "0" +unicode(1) "0" ===DONE=== diff --git a/ext/phar/tests/invalid_alias.phpt b/ext/phar/tests/invalid_alias.phpt index dc0c71ed11..97ebe0fe1a 100644 --- a/ext/phar/tests/invalid_alias.phpt +++ b/ext/phar/tests/invalid_alias.phpt @@ -42,4 +42,4 @@ Invalid alias "hi/" specified for phar "%sinvalid_alias.phar" Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar" Invalid alias "hil;" specified for phar "%sinvalid_alias.phar" Invalid alias ":hil" specified for phar "%sinvalid_alias.phar" -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/invalid_setstubalias.phpt b/ext/phar/tests/invalid_setstubalias.phpt index 04cb779ddb..86fa6e7f78 100644 --- a/ext/phar/tests/invalid_setstubalias.phpt +++ b/ext/phar/tests/invalid_setstubalias.phpt @@ -44,4 +44,4 @@ Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.t Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/metadata_read.phpt b/ext/phar/tests/metadata_read.phpt index c3d12d6fbd..6f6266c00c 100644 --- a/ext/phar/tests/metadata_read.phpt +++ b/ext/phar/tests/metadata_read.phpt @@ -8,7 +8,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont' => 'a'); @@ -41,18 +41,18 @@ string(1) "b" string(1) "c" string(1) "d" NULL -string(8) "hi there" +unicode(8) "hi there" array(2) { [0]=> - string(2) "hi" + unicode(2) "hi" [1]=> - string(5) "there" + unicode(5) "there" } array(2) { - ["hi"]=> - string(5) "there" - ["foo"]=> - string(3) "bar" + [u"hi"]=> + unicode(5) "there" + [u"foo"]=> + unicode(3) "bar" } string(1) "a" string(1) "b" diff --git a/ext/phar/tests/metadata_write.phpt b/ext/phar/tests/metadata_write.phpt index 4b9930b693..d2f8901ba4 100755 --- a/ext/phar/tests/metadata_write.phpt +++ b/ext/phar/tests/metadata_write.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont' => 'a'); @@ -51,8 +51,8 @@ NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) string(1) "a" diff --git a/ext/phar/tests/metadata_write_commit.phpt b/ext/phar/tests/metadata_write_commit.phpt index 0d0a5e56ad..95c53db963 100755 --- a/ext/phar/tests/metadata_write_commit.phpt +++ b/ext/phar/tests/metadata_write_commit.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont' => 'a'); @@ -59,8 +59,8 @@ NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) string(1) "a" @@ -72,8 +72,8 @@ NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) ===DONE=== diff --git a/ext/phar/tests/mkdir.phpt b/ext/phar/tests/mkdir.phpt index 45c1d4674f..b3c70fb7a6 100644 --- a/ext/phar/tests/mkdir.phpt +++ b/ext/phar/tests/mkdir.phpt @@ -44,4 +44,4 @@ Warning: rmdir(): phar error: cannot remove directory "" in phar "foo.phar", dir Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is a not a directory in %smkdir.php on line %d Cannot create a directory in magic ".phar" directory -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/mounteddir.phpt b/ext/phar/tests/mounteddir.phpt index 51a42695d7..2f9ec44890 100644 --- a/ext/phar/tests/mounteddir.phpt +++ b/ext/phar/tests/mounteddir.phpt @@ -112,4 +112,4 @@ Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php f Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/open_for_write_existing.phpt b/ext/phar/tests/open_for_write_existing.phpt index 2a3ec8b824..5b7b128bd7 100644 --- a/ext/phar/tests/open_for_write_existing.phpt +++ b/ext/phar/tests/open_for_write_existing.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; $fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; ?> diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index 6c3cd3e986..83984eb2eb 100755 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -24,7 +24,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; ?> @@ -32,11 +32,10 @@ include $pname . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d -Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d This is b/c -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index 9bbaaae92a..728b7591bc 100755 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; $fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; ?> @@ -26,11 +26,10 @@ include $pname . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d This is b/c -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/open_for_write_newfile.phpt b/ext/phar/tests/open_for_write_newfile.phpt index 13114072da..fdccd16dbf 100644 --- a/ext/phar/tests/open_for_write_newfile.phpt +++ b/ext/phar/tests/open_for_write_newfile.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; $fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; include $pname . '/b/new.php'; diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 1c136ff1d5..9e340ad87f 100755 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -24,7 +24,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; include $pname . '/b/new.php'; @@ -34,15 +34,14 @@ include $pname . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d -Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line 20 +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d This is b/c -Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line 22 +Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index 59b4339eb9..e3d82e579b 100755 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; $fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $pname . '/b/c.php'; include $pname . '/b/new.php'; @@ -28,16 +28,15 @@ include $pname . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d -Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d +Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line 16 -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/opendir.phpt b/ext/phar/tests/opendir.phpt index 46ab7c9682..8d462e3fa0 100644 --- a/ext/phar/tests/opendir.phpt +++ b/ext/phar/tests/opendir.phpt @@ -39,4 +39,4 @@ phar url "phar://" is unknown in %sopendir.php on line %d Warning: opendir(phar://hi.phar): failed to open dir: phar error: invalid url or non-existent phar "phar://hi.phar" phar url "phar://hi.phar" is unknown in %sopendir.php on line %d -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt index d330d27ff3..6a5900485e 100644 --- a/ext/phar/tests/opendir_edgecases.phpt +++ b/ext/phar/tests/opendir_edgecases.phpt @@ -37,10 +37,12 @@ include $pname . '/foo'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> <?php rmdir(dirname(__FILE__) . '/poo'); --EXPECTF-- -Warning: opendir() expects parameter 1 to be string, array given in %sopendir_edgecases.php on line %d +Notice: Array to string conversion in %sopendir_edgecases.php on line %d + +Warning: opendir(Array): failed to open dir: No such file or directory in %sopendir_edgecases.php on line %d . .. foo Warning: opendir(phar://%sopendir_edgecases.phar.php/oops): failed to open dir: %s in phar://%sopendir_edgecases.phar.php/foo on line %d -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/phar_begin_setstub_commit.phpt b/ext/phar/tests/phar_begin_setstub_commit.phpt index d36865ddc5..f7ae550052 100755 --- a/ext/phar/tests/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/phar_begin_setstub_commit.phpt @@ -35,16 +35,16 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar'); --EXPECT-- bool(true) bool(false) -string(5) "Hello" +unicode(5) "Hello" string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " -string(5) "World" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " ===COMMIT=== bool(true) -string(5) "Hello" -string(5) "World" +unicode(5) "Hello" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " ===DONE=== diff --git a/ext/phar/tests/phar_buildfromdirectory1.phpt b/ext/phar/tests/phar_buildfromdirectory1.phpt index 505b15036f..060d66fbb8 100644 --- a/ext/phar/tests/phar_buildfromdirectory1.phpt +++ b/ext/phar/tests/phar_buildfromdirectory1.phpt @@ -23,6 +23,6 @@ unlink(dirname(__FILE__) . '/buildfromdirectory.phar'); __HALT_COMPILER(); ?> --EXPECT-- -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Cannot write to archive - write operations restricted by INI setting ===DONE=== diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index fcad4725a7..a306f74914 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -22,6 +22,6 @@ unlink(dirname(__FILE__) . '/buildfromdirectory.phar'); __HALT_COMPILER(); ?> --EXPECT-- -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" RecursiveDirectoryIterator::__construct(1): failed to open dir: No such file or directory ===DONE=== diff --git a/ext/phar/tests/phar_buildfromdirectory3.phpt b/ext/phar/tests/phar_buildfromdirectory3.phpt index 435bbdfba6..a9f00987f3 100644 --- a/ext/phar/tests/phar_buildfromdirectory3.phpt +++ b/ext/phar/tests/phar_buildfromdirectory3.phpt @@ -23,5 +23,5 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar'); __HALT_COMPILER(); ?> --EXPECTF-- -Warning: Phar::buildFromDirectory() expects parameter 2 to be string, object given in %sphar_buildfromdirectory3.php on line %d +Warning: Phar::buildFromDirectory() expects parameter 2 to be binary string, object given in %sphar_buildfromdirectory3.php on line %d ===DONE=== diff --git a/ext/phar/tests/phar_buildfromiterator1.phpt b/ext/phar/tests/phar_buildfromiterator1.phpt index f75823f94c..460a405a45 100644 --- a/ext/phar/tests/phar_buildfromiterator1.phpt +++ b/ext/phar/tests/phar_buildfromiterator1.phpt @@ -23,6 +23,6 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar'); __HALT_COMPILER(); ?> --EXPECT-- -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Cannot write out phar archive, phar is read-only ===DONE=== diff --git a/ext/phar/tests/phar_buildfromiterator3.phpt b/ext/phar/tests/phar_buildfromiterator3.phpt index 5fca706041..93adf9fa6c 100644 --- a/ext/phar/tests/phar_buildfromiterator3.phpt +++ b/ext/phar/tests/phar_buildfromiterator3.phpt @@ -50,5 +50,5 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar'); __HALT_COMPILER(); ?> --EXPECTF-- -Warning: Phar::buildFromIterator() expects parameter 2 to be string, object given in %sphar_buildfromiterator3.php on line %d +Warning: Phar::buildFromIterator() expects parameter 2 to be binary string, object given in %sphar_buildfromiterator3.php on line %d ===DONE=== diff --git a/ext/phar/tests/phar_buildfromiterator5.phpt b/ext/phar/tests/phar_buildfromiterator5.phpt index 3bd2cec78c..8f341ed215 100644 --- a/ext/phar/tests/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/phar_buildfromiterator5.phpt @@ -54,6 +54,6 @@ __HALT_COMPILER(); rewind valid current -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid value (must return a string) ===DONE=== diff --git a/ext/phar/tests/phar_buildfromiterator6.phpt b/ext/phar/tests/phar_buildfromiterator6.phpt index ae73bbd479..71083788c9 100644 --- a/ext/phar/tests/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/phar_buildfromiterator6.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid key (must return a string) ===DONE=== diff --git a/ext/phar/tests/phar_buildfromiterator7.phpt b/ext/phar/tests/phar_buildfromiterator7.phpt index 38d2e1a5f2..e717059488 100644 --- a/ext/phar/tests/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/phar_buildfromiterator7.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" ===DONE=== diff --git a/ext/phar/tests/phar_bz2.phpt b/ext/phar/tests/phar_bz2.phpt index 71b10f9092..7380ea6fd1 100644 --- a/ext/phar/tests/phar_bz2.phpt +++ b/ext/phar/tests/phar_bz2.phpt @@ -14,7 +14,7 @@ $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/phar_bz2.2.phar'; $pname2 = 'phar://' . $fname2; -$file = '<?php +$file = (binary)'<?php Phar::mapPhar(); var_dump("it worked"); include "phar://" . __FILE__ . "/tar_004.php"; @@ -53,8 +53,8 @@ echo $e->getMessage(),"\n"; @unlink(dirname(__FILE__) . '/phar_bz2.2.phar'); ?> --EXPECTF-- -string(9) "it worked" -string(%d) "phar://%sphar_bz2.phar/tar_004.php" +unicode(9) "it worked" +unicode(%d) "phar://%sphar_bz2.phar/tar_004.php" bool(true) bool(true) diff --git a/ext/phar/tests/phar_commitwrite.phpt b/ext/phar/tests/phar_commitwrite.phpt index 447d1e8309..36d473e5c2 100644 --- a/ext/phar/tests/phar_commitwrite.phpt +++ b/ext/phar/tests/phar_commitwrite.phpt @@ -29,7 +29,7 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar'); __HALT_COMPILER(); ?> --EXPECT-- -int(6659) +int(6683) string(200) "<?php function __autoload($class) { diff --git a/ext/phar/tests/phar_convert_again.phpt b/ext/phar/tests/phar_convert_again.phpt index 4543a238d5..3b1e4a76a9 100644 --- a/ext/phar/tests/phar_convert_again.phpt +++ b/ext/phar/tests/phar_convert_again.phpt @@ -13,8 +13,7 @@ phar.readonly=0 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '2.tbz'; $pname = 'phar://' . $fname; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_convert_repeated.phpt b/ext/phar/tests/phar_convert_repeated.phpt index fe0888ebbf..74c0ca493c 100644 --- a/ext/phar/tests/phar_convert_repeated.phpt +++ b/ext/phar/tests/phar_convert_repeated.phpt @@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -123,7 +122,7 @@ NULL bool(true) bool(false) bool(false) -int(6659) +int(6683) NULL ================= convertToZip() ===================== bool(false) diff --git a/ext/phar/tests/phar_convert_tar.phpt b/ext/phar/tests/phar_convert_tar.phpt index d4031ec32f..926b3ebc89 100644 --- a/ext/phar/tests/phar_convert_tar.phpt +++ b/ext/phar/tests/phar_convert_tar.phpt @@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar'; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_convert_tar2.phpt b/ext/phar/tests/phar_convert_tar2.phpt index f0f0f69825..5669701289 100644 --- a/ext/phar/tests/phar_convert_tar2.phpt +++ b/ext/phar/tests/phar_convert_tar2.phpt @@ -13,8 +13,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar.gz'; $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar'; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_convert_tar3.phpt b/ext/phar/tests/phar_convert_tar3.phpt index 52fd0f555a..fe71d5a0cd 100644 --- a/ext/phar/tests/phar_convert_tar3.phpt +++ b/ext/phar/tests/phar_convert_tar3.phpt @@ -13,8 +13,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar'; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_convert_zip.phpt b/ext/phar/tests/phar_convert_zip.phpt index 734551ee9c..4dfa061817 100644 --- a/ext/phar/tests/phar_convert_zip.phpt +++ b/ext/phar/tests/phar_convert_zip.phpt @@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.zip'; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; -$file = $stub; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt index c4f74b6d6c..4b0e6594fb 100644 --- a/ext/phar/tests/phar_create_in_cwd.phpt +++ b/ext/phar/tests/phar_create_in_cwd.phpt @@ -32,7 +32,7 @@ __HALT_COMPILER(); unlink(dirname(__FILE__) . '/brandnewphar.phar'); ?> --EXPECT-- -int(6659) +int(6683) string(200) "<?php function __autoload($class) { diff --git a/ext/phar/tests/phar_createdefaultstub.phpt b/ext/phar/tests/phar_createdefaultstub.phpt index 642aac9acc..abc9ad8e5b 100644 --- a/ext/phar/tests/phar_createdefaultstub.phpt +++ b/ext/phar/tests/phar_createdefaultstub.phpt @@ -34,7 +34,7 @@ echo $e->getMessage() . "\n"; ?> ===DONE=== --EXPECT-- -string(6659) "<?php +string(6683) "<?php $web = 'index.php'; @@ -144,21 +144,21 @@ const GZ = 0x1000; 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 @@ Extract_Phar::go(); __HALT_COMPILER(); ?>" ============================================================================ ============================================================================ -string(6670) "<?php +string(6694) "<?php $web = 'index.php'; @@ -438,21 +438,21 @@ const GZ = 0x1000; 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 @@ Extract_Phar::go(); __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 @@ Illegal filename passed in for stub creation, was 401 characters long, and only ============================================================================ ============================================================================ ============================================================================ -string(6672) "<?php +string(6696) "<?php $web = 'the/web.php'; @@ -740,21 +740,21 @@ const GZ = 0x1000; 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 @@ Extract_Phar::go(); __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=== diff --git a/ext/phar/tests/phar_ctx_001.phpt b/ext/phar/tests/phar_ctx_001.phpt index 13b4d6a781..4244566eaf 100644 --- a/ext/phar/tests/phar_ctx_001.phpt +++ b/ext/phar/tests/phar_ctx_001.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -31,9 +31,9 @@ var_dump($phar['c']->isCompressed()); $context = stream_context_create(array('phar'=> array('compress'=>Phar::GZ, 'metadata' => array(2, 'hi' => 3)))); $context2 = stream_context_create(array('phar' => array('metadata' => array(4)))); -file_put_contents($pname . '/a', 'new a', 0); // no compression -file_put_contents($pname . '/b', 'new b', 0, $context); -file_put_contents($pname . '/d', 'new d', 0, $context2); +file_put_contents($pname . '/a', (binary)'new a', 0); // no compression +file_put_contents($pname . '/b', (binary)'new b', 0, $context); +file_put_contents($pname . '/d', (binary)'new d', 0, $context2); $phar = new Phar($fname); var_dump(file_get_contents($pname . '/a')); diff --git a/ext/phar/tests/phar_decompress.phpt b/ext/phar/tests/phar_decompress.phpt index ae199eb03b..0ec692dc09 100644 --- a/ext/phar/tests/phar_decompress.phpt +++ b/ext/phar/tests/phar_decompress.phpt @@ -11,7 +11,7 @@ phar.readonly=0 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '2.phar.gz'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -63,7 +63,7 @@ int(4096) %sphar_decompress.phar %sphar_decompress.hooba.phar -Warning: Phar::decompress() expects parameter 1 to be string, array given in %sphar_decompress.php on line %d +Warning: Phar::decompress() expects parameter 1 to be binary string, array given in %sphar_decompress.php on line %d Cannot decompress phar archive, phar is read-only Cannot decompress zip-based archives with whole-archive compression ===DONE=== diff --git a/ext/phar/tests/phar_dotted_path.phpt b/ext/phar/tests/phar_dotted_path.phpt index f6d626e6cf..8b88d02389 100644 --- a/ext/phar/tests/phar_dotted_path.phpt +++ b/ext/phar/tests/phar_dotted_path.phpt @@ -13,8 +13,7 @@ $dir = dirname(__FILE__) . '/broken.dirname'; mkdir($dir, 0777); $fname = $dir . '/dotted_path.phar'; -$stub = Phar::createDefaultStub(); -$file = $stub; +$file = (binary)Phar::createDefaultStub(); $files = array(); $files['a'] = 'this is a'; diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index 82e5f8d191..40d3df391d 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -119,7 +119,7 @@ string(3) "hi2" bool(false) Invalid argument, expected a filename (string) or array of filenames -Warning: Phar::extractTo() expects parameter 1 to be string, array given in %sphar_extract.php on line %d +Warning: Phar::extractTo() expects parameter 1 to be binary string, array given in %sphar_extract.php on line %d Invalid argument, extraction path must be non-zero length Unable to use path "%soops" for extraction, it is a file, must be a directory Invalid argument, array of filenames to extract contains non-string value diff --git a/ext/phar/tests/phar_gzip.phpt b/ext/phar/tests/phar_gzip.phpt index f472949c05..d026c45cba 100644 --- a/ext/phar/tests/phar_gzip.phpt +++ b/ext/phar/tests/phar_gzip.phpt @@ -15,7 +15,7 @@ $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/phar_gzip.2.phar'; $pname2 = 'phar://' . $fname2; -$file = '<?php +$file = (binary)'<?php Phar::mapPhar(); var_dump("it worked"); include "phar://" . __FILE__ . "/tar_004.php"; @@ -47,8 +47,8 @@ var_dump($b->isCompressed() == Phar::GZ); @unlink(dirname(__FILE__) . '/phar_gzip.2.phar'); ?> --EXPECTF-- -string(9) "it worked" -string(%d) "phar://%sphar_gzip.phar/tar_004.php" +unicode(9) "it worked" +unicode(%d) "phar://%sphar_gzip.phar/tar_004.php" bool(true) bool(true) ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/phar_isvalidpharfilename.phpt b/ext/phar/tests/phar_isvalidpharfilename.phpt index 9c953ee88a..2940948242 100644 --- a/ext/phar/tests/phar_isvalidpharfilename.phpt +++ b/ext/phar/tests/phar_isvalidpharfilename.phpt @@ -76,7 +76,7 @@ var_dump(Phar::isValidPharFilename('dir.phar.php', false)); <?php rmdir(dirname(__FILE__) . '/.phar'); --EXPECTF-- -Warning: Phar::isValidPharFilename() expects parameter 1 to be string, array given in %sphar_isvalidpharfilename.php on line %d +Warning: Phar::isValidPharFilename() expects parameter 1 to be binary string, array given in %sphar_isvalidpharfilename.php on line %d * bool(false) bool(false) diff --git a/ext/phar/tests/phar_metadata_read.phpt b/ext/phar/tests/phar_metadata_read.phpt index bda411f740..a0ee3fa7bd 100644 --- a/ext/phar/tests/phar_metadata_read.phpt +++ b/ext/phar/tests/phar_metadata_read.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $pmeta = 'hi there'; @@ -53,7 +53,7 @@ string(1) "b" string(1) "c" string(1) "d" bool(true) -string(8) "hi there" +unicode(8) "hi there" bool(true) NULL bool(true) @@ -72,19 +72,19 @@ NULL bool(true) array(2) { [0]=> - string(2) "hi" + unicode(2) "hi" [1]=> - string(5) "there" + unicode(5) "there" } bool(true) NULL meta d bool(true) array(2) { - ["hi"]=> - string(5) "there" - ["foo"]=> - string(3) "bar" + [u"hi"]=> + unicode(5) "there" + [u"foo"]=> + unicode(3) "bar" } bool(true) NULL diff --git a/ext/phar/tests/phar_metadata_write.phpt b/ext/phar/tests/phar_metadata_write.phpt index 6df7ba4faf..cbef9405fa 100644 --- a/ext/phar/tests/phar_metadata_write.phpt +++ b/ext/phar/tests/phar_metadata_write.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a'] = array('cont' => 'a'); @@ -52,16 +52,16 @@ string(1) "c" string(1) "d" NULL array(1) { - ["my"]=> - string(6) "friend" + [u"my"]=> + unicode(6) "friend" } int(42) NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) string(1) "a" diff --git a/ext/phar/tests/phar_offset_check.phpt b/ext/phar/tests/phar_offset_check.phpt index 7e00d4b50e..fe12534915 100644 --- a/ext/phar/tests/phar_offset_check.phpt +++ b/ext/phar/tests/phar_offset_check.phpt @@ -70,8 +70,8 @@ var_dump($phar->getAlias()); 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" diff --git a/ext/phar/tests/phar_oo_001.phpt b/ext/phar/tests/phar_oo_001.phpt index 81d57d1bfc..5f1a4e70cb 100755 --- a/ext/phar/tests/phar_oo_001.phpt +++ b/ext/phar/tests/phar_oo_001.phpt @@ -49,6 +49,6 @@ __halt_compiler(); --EXPECT-- string(5) "1.0.0" int(5) -string(50) "Cannot call method on an uninitialized Phar object" -string(29) "Cannot call constructor twice" +unicode(50) "Cannot call method on an uninitialized Phar object" +unicode(29) "Cannot call constructor twice" ===DONE=== diff --git a/ext/phar/tests/phar_oo_compressallbz2.phpt b/ext/phar/tests/phar_oo_compressallbz2.phpt index 3f52227194..eb5c676497 100644 --- a/ext/phar/tests/phar_oo_compressallbz2.phpt +++ b/ext/phar/tests/phar_oo_compressallbz2.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_oo_compressallgz.phpt b/ext/phar/tests/phar_oo_compressallgz.phpt index 55e7435f95..74cac42536 100644 --- a/ext/phar/tests/phar_oo_compressallgz.phpt +++ b/ext/phar/tests/phar_oo_compressallgz.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_oo_compressed_001.phpt b/ext/phar/tests/phar_oo_compressed_001.phpt index af02012573..30d86bd90f 100644 --- a/ext/phar/tests/phar_oo_compressed_001.phpt +++ b/ext/phar/tests/phar_oo_compressed_001.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_oo_compressed_001b.phpt b/ext/phar/tests/phar_oo_compressed_001b.phpt index 6d4c732862..a1bbd0bae2 100755 --- a/ext/phar/tests/phar_oo_compressed_001b.phpt +++ b/ext/phar/tests/phar_oo_compressed_001b.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_oo_compressed_002.phpt b/ext/phar/tests/phar_oo_compressed_002.phpt index d03d6f1a98..601a0fbfbd 100755 --- a/ext/phar/tests/phar_oo_compressed_002.phpt +++ b/ext/phar/tests/phar_oo_compressed_002.phpt @@ -10,7 +10,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -30,10 +30,10 @@ var_dump($phar['c']->isCompressed()); $context = stream_context_create(array('phar'=>array('compress'=>Phar::GZ))); -file_put_contents($pname . '/b', 'new b'); -file_put_contents($pname . '/c', 'new c', 0, $context); -file_put_contents($pname . '/d', 'new d'); -file_put_contents($pname . '/e', 'new e', 0, $context); +file_put_contents($pname . '/b', (binary)'new b'); +file_put_contents($pname . '/c', (binary)'new c', 0, $context); +file_put_contents($pname . '/d', (binary)'new d'); +file_put_contents($pname . '/e', (binary)'new e', 0, $context); $phar = new Phar($fname); var_dump(file_get_contents($pname . '/a')); diff --git a/ext/phar/tests/phar_oo_compressed_002b.phpt b/ext/phar/tests/phar_oo_compressed_002b.phpt index 0e167012b7..28dd6c4c84 100755 --- a/ext/phar/tests/phar_oo_compressed_002b.phpt +++ b/ext/phar/tests/phar_oo_compressed_002b.phpt @@ -10,7 +10,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -30,10 +30,10 @@ var_dump($phar['c']->isCompressed()); $context = stream_context_create(array('phar'=>array('compress'=>Phar::BZ2))); -file_put_contents($pname . '/b', 'new b'); -file_put_contents($pname . '/c', 'new c', 0, $context); -file_put_contents($pname . '/d', 'new d'); -file_put_contents($pname . '/e', 'new e', 0, $context); +file_put_contents($pname . '/b', (binary)'new b'); +file_put_contents($pname . '/c', (binary)'new c', 0, $context); +file_put_contents($pname . '/d', (binary)'new d'); +file_put_contents($pname . '/e', (binary)'new e', 0, $context); $phar = new Phar($fname); var_dump(file_get_contents($pname . '/a')); diff --git a/ext/phar/tests/phar_oo_getmodified.phpt b/ext/phar/tests/phar_oo_getmodified.phpt index d531393281..d27c852d49 100644 --- a/ext/phar/tests/phar_oo_getmodified.phpt +++ b/ext/phar/tests/phar_oo_getmodified.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_oo_iswriteable.phpt b/ext/phar/tests/phar_oo_iswriteable.phpt index 9fbca2c9ea..8e61d900a0 100644 --- a/ext/phar/tests/phar_oo_iswriteable.phpt +++ b/ext/phar/tests/phar_oo_iswriteable.phpt @@ -10,7 +10,7 @@ phar.require_hash=0 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php'; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.tar'; $pname = 'phar://hio'; -$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>'; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>'; diff --git a/ext/phar/tests/phar_oo_uncompressall.phpt b/ext/phar/tests/phar_oo_uncompressall.phpt index 19cf953197..946a0b470f 100644 --- a/ext/phar/tests/phar_oo_uncompressall.phpt +++ b/ext/phar/tests/phar_oo_uncompressall.phpt @@ -10,7 +10,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php __HALT_COMPILER(); ?>'; +$file = (binary)'<?php __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_setalias.phpt b/ext/phar/tests/phar_setalias.phpt index ef9fa283d5..d2b6a3703e 100644 --- a/ext/phar/tests/phar_setalias.phpt +++ b/ext/phar/tests/phar_setalias.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_setalias2.phpt b/ext/phar/tests/phar_setalias2.phpt index 901e4d2ebd..b92ab4bdff 100644 --- a/ext/phar/tests/phar_setalias2.phpt +++ b/ext/phar/tests/phar_setalias2.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; diff --git a/ext/phar/tests/phar_setdefaultstub.phpt b/ext/phar/tests/phar_setdefaultstub.phpt index e907ca1236..434e6471f5 100644 --- a/ext/phar/tests/phar_setdefaultstub.phpt +++ b/ext/phar/tests/phar_setdefaultstub.phpt @@ -54,7 +54,7 @@ try { unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> --EXPECT-- -string(6661) "<?php +string(6685) "<?php $web = 'index.php'; @@ -164,21 +164,21 @@ const GZ = 0x1000; 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 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -string(6672) "<?php +string(6696) "<?php $web = 'index.php'; @@ -459,21 +459,21 @@ const GZ = 0x1000; 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 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -string(6674) "<?php +string(6698) "<?php $web = 'the/web.php'; @@ -754,21 +754,21 @@ const GZ = 0x1000; 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 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -int(7052) +int(7076) Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed ===DONE=== diff --git a/ext/phar/tests/phar_stub.phpt b/ext/phar/tests/phar_stub.phpt index ed306816e2..7ce7bd0803 100644 --- a/ext/phar/tests/phar_stub.phpt +++ b/ext/phar/tests/phar_stub.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $files = array(); $files['a'] = 'a'; @@ -18,13 +18,13 @@ $files['c'] = 'c'; include 'files/phar_test.inc'; -$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $fp = fopen($fname, 'rb'); //// 1 echo fread($fp, strlen($file)) . "\n"; fclose($fp); $phar = new Phar($fname); -$file = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; //// 2 $phar->setStub($file); @@ -33,9 +33,9 @@ echo fread($fp, strlen($file)) . "\n"; fclose($fp); $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phartmp.php'; -$file = '<?php echo "third stub\n"; __HALT_COMPILER(); ?>'; +$file = (binary)'<?php echo "third stub\n"; __HALT_COMPILER(); ?>'; $fp = fopen($fname2, 'wb'); -fwrite($fp, $file); +fwrite($fp, (binary)$file); fclose($fp); $fp = fopen($fname2, 'rb'); @@ -48,7 +48,7 @@ echo fread($fp, strlen($file)) . "\n"; fclose($fp); $fp = fopen($fname2, 'ab'); -fwrite($fp, 'booya'); +fwrite($fp, (binary)'booya'); fclose($fp); echo file_get_contents($fname2) . "\n"; @@ -69,7 +69,7 @@ $phar['testing'] = 'hi'; // ensure stub is not overwritten $fp = fopen($fname, 'rb'); echo fread($fp, strlen($file)) . "\n"; -if (fread($fp, strlen('booya')) == 'booya') { +if (fread($fp, strlen('booya')) == (binary)'booya') { echo 'failed - copied booya'; } fclose($fp); diff --git a/ext/phar/tests/phar_stub_error.phpt b/ext/phar/tests/phar_stub_error.phpt index 99f313bc2f..2fe8bbef84 100755 --- a/ext/phar/tests/phar_stub_error.phpt +++ b/ext/phar/tests/phar_stub_error.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $file = $stub; $files = array(); @@ -22,7 +22,7 @@ var_dump($stub); var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); -$newstub = '<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>'; +$newstub = (binary)'<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>'; try { $phar->setStub($newstub); diff --git a/ext/phar/tests/phar_stub_write.phpt b/ext/phar/tests/phar_stub_write.phpt index 9e5d6d5635..975c9bf5de 100755 --- a/ext/phar/tests/phar_stub_write.phpt +++ b/ext/phar/tests/phar_stub_write.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $file = $stub; $files = array(); @@ -24,7 +24,7 @@ var_dump($stub); var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); -$stub = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; +$stub = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; $sexp = $stub . "\r\n"; $phar->setStub($stub); diff --git a/ext/phar/tests/phar_stub_write_file.phpt b/ext/phar/tests/phar_stub_write_file.phpt index c5a0a1eba9..fa58c12ded 100755 --- a/ext/phar/tests/phar_stub_write_file.phpt +++ b/ext/phar/tests/phar_stub_write_file.phpt @@ -10,7 +10,7 @@ allow_url_fopen=1 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; +$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>'; $file = $stub; $files = array(); @@ -25,7 +25,7 @@ var_dump($stub); var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); -$stub = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; +$stub = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>'; $sexp = $stub . "\r\n"; $stub = fopen('data://,'.$stub, 'r'); $phar->setStub($stub); diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt index 910ef873d2..54c18324dc 100644 --- a/ext/phar/tests/phar_unlinkarchive.phpt +++ b/ext/phar/tests/phar_unlinkarchive.phpt @@ -90,7 +90,7 @@ Unknown phar archive "" Unknown phar archive "%sphar_unlinkarchive.phar" Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry) -Warning: Phar::unlinkArchive() expects parameter 1 to be string, array given in %sphar_unlinkarchive.php on line %d +Warning: Phar::unlinkArchive() expects parameter 1 to be binary string, array given in %sphar_unlinkarchive.php on line %d bool(false) string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>" phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive() diff --git a/ext/phar/tests/pharfileinfo_construct.phpt b/ext/phar/tests/pharfileinfo_construct.phpt index 480c1222c4..46b1d170a8 100644 --- a/ext/phar/tests/pharfileinfo_construct.phpt +++ b/ext/phar/tests/pharfileinfo_construct.phpt @@ -47,7 +47,7 @@ echo $e->getMessage() . "\n"; --EXPECTF-- Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry) -Warning: PharFileInfo::__construct() expects parameter 1 to be string, array given in %spharfileinfo_construct.php on line %d +Warning: PharFileInfo::__construct() expects parameter 1 to be binary string, array given in %spharfileinfo_construct.php on line %d Cannot access phar file entry '/oops/I/do/not/exist' in archive '%spharfileinfo_construct.phar' Cannot call constructor twice '%spharfileinfo_construct.php' is not a valid phar archive URL (must have at least phar://filename.phar) diff --git a/ext/phar/tests/pharfileinfo_getcrc32.phpt b/ext/phar/tests/pharfileinfo_getcrc32.phpt index dfa12f4ca4..f1d0f18282 100644 --- a/ext/phar/tests/pharfileinfo_getcrc32.phpt +++ b/ext/phar/tests/pharfileinfo_getcrc32.phpt @@ -9,7 +9,7 @@ phar.readonly=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/readfile_edgecases.phpt b/ext/phar/tests/readfile_edgecases.phpt index 1a78d7b5b0..d49fd3e96b 100644 --- a/ext/phar/tests/readfile_edgecases.phpt +++ b/ext/phar/tests/readfile_edgecases.phpt @@ -35,7 +35,9 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: readfile() expects parameter 1 to be string, array given in %sreadfile_edgecases.php on line %d +Notice: Array to string conversion in %sreadfile_edgecases.php on line %d + +Warning: readfile(Array): failed to open stream: No such file or directory in %sreadfile_edgecases.php on line %d blah <?php readfile("foo/" . basename(__FILE__)); diff --git a/ext/phar/tests/refcount1.phpt b/ext/phar/tests/refcount1.phpt index 234d49111c..e147a3ee0d 100644 --- a/ext/phar/tests/refcount1.phpt +++ b/ext/phar/tests/refcount1.phpt @@ -11,7 +11,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php __HALT_COMPILER(); ?>"; +$file = (binary)"<?php __HALT_COMPILER(); ?>"; $files = array(); $files['a.php'] = '<?php echo "This is a\n"; ?>'; @@ -20,7 +20,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; $fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, "extra"); +fwrite($fp, (binary)"extra"); fclose($fp); echo "===CLOSE===\n"; $p = new Phar($fname); @@ -42,9 +42,9 @@ include $pname . '/b/c.php'; --EXPECTF-- ===CLOSE=== object(PharFileInfo)#%d (2) { - ["pathName":"SplFileInfo":private]=> + [u"pathName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.php/b" - ["fileName":"SplFileInfo":private]=> + [u"fileName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.php/b/c.php" } string(5) "extra" @@ -52,9 +52,9 @@ string(5) "extra" Warning: unlink(): phar error: "b/c.php" in phar "%srefcount1.phar.php", has open file pointers, cannot unlink in %srefcount1.php on line %d object(PharFileInfo)#%d (2) { - ["pathName":"SplFileInfo":private]=> + [u"pathName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.php/b" - ["fileName":"SplFileInfo":private]=> + [u"fileName":u"SplFileInfo":private]=> string(%s) "phar://%srefcount1.phar.php/b/c.php" } string(5) "extra" diff --git a/ext/phar/tests/rename.phpt b/ext/phar/tests/rename.phpt index c73c98ec81..499f45d942 100644 --- a/ext/phar/tests/rename.phpt +++ b/ext/phar/tests/rename.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -$file = "<?php +$file = (binary)"<?php Phar::mapPhar('hio'); __HALT_COMPILER(); ?>"; diff --git a/ext/phar/tests/tar/all.phpt b/ext/phar/tests/tar/all.phpt index 5eb1839867..af5ebc9b0c 100644 --- a/ext/phar/tests/tar/all.phpt +++ b/ext/phar/tests/tar/all.phpt @@ -47,10 +47,10 @@ bool(false) string(2) "hi" string(3) "hi2" string(3) "hi3" -string(6) "100444" +unicode(6) "100444" string(32) "<?php ok __HALT_COMPILER(); ?> " string(4) "hime" -string(8) "hi there" -string(6) "a meta" +unicode(8) "hi there" +unicode(6) "a meta" ===DONE=== diff --git a/ext/phar/tests/tar/files/make_invalid_tar.php.inc b/ext/phar/tests/tar/files/make_invalid_tar.php.inc index c18bd199b3..413dd7bd1b 100644 --- a/ext/phar/tests/tar/files/make_invalid_tar.php.inc +++ b/ext/phar/tests/tar/files/make_invalid_tar.php.inc @@ -3,7 +3,7 @@ include dirname(__FILE__) . '/tarmaker.php.inc'; class corrupter extends tarmaker { function close() { - fwrite($this->tmp, 'oopsie'); + fwrite($this->tmp, (binary)'oopsie'); fclose($this->tmp); } } \ No newline at end of file diff --git a/ext/phar/tests/tar/files/tarmaker.php.inc b/ext/phar/tests/tar/files/tarmaker.php.inc index 902507881a..446e4a20aa 100644 --- a/ext/phar/tests/tar/files/tarmaker.php.inc +++ b/ext/phar/tests/tar/files/tarmaker.php.inc @@ -107,16 +107,16 @@ class tarmaker $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)); } } } @@ -163,7 +163,7 @@ class tarmaker */ function close() { - fwrite($this->tmp, pack('a1024', '')); + fwrite($this->tmp, (binary)pack('a1024', '')); fclose($this->tmp); } } \ No newline at end of file diff --git a/ext/phar/tests/tar/frontcontroller10.phar.phpt b/ext/phar/tests/tar/frontcontroller10.phar.phpt index 6d84b6ed68..f1fc6e3d0f 100644 --- a/ext/phar/tests/tar/frontcontroller10.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller10.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite array invalid tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller4.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 Status: 403 Access Denied --EXPECT-- <html> diff --git a/ext/phar/tests/tar/frontcontroller11.phar.phpt b/ext/phar/tests/tar/frontcontroller11.phar.phpt index f6dfaf2740..f58d6fd661 100644 --- a/ext/phar/tests/tar/frontcontroller11.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller11.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type extension is not a string tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller5.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller12.phar.phpt b/ext/phar/tests/tar/frontcontroller12.phar.phpt index 760e8422c9..2086856cf3 100644 --- a/ext/phar/tests/tar/frontcontroller12.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller12.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type unknown int tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller6.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller13.phar.phpt b/ext/phar/tests/tar/frontcontroller13.phar.phpt index da5dc041a0..ce7620a198 100644 --- a/ext/phar/tests/tar/frontcontroller13.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller13.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type not string/int tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller7.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller15.phar.phpt b/ext/phar/tests/tar/frontcontroller15.phar.phpt index 367ea72533..2147121dbe 100644 --- a/ext/phar/tests/tar/frontcontroller15.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller15.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHPS tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller8.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/tar/frontcontroller16.phar.phpt b/ext/phar/tests/tar/frontcontroller16.phar.phpt index ab4a28237f..caa0c3119d 100644 --- a/ext/phar/tests/tar/frontcontroller16.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller16.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHP tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller8.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio1 diff --git a/ext/phar/tests/tar/frontcontroller2.phar.phpt b/ext/phar/tests/tar/frontcontroller2.phar.phpt index e7b5346889..82070e3b55 100644 --- a/ext/phar/tests/tar/frontcontroller2.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller2.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller PHP test tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,6 +11,6 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio diff --git a/ext/phar/tests/tar/frontcontroller21.phar.phpt b/ext/phar/tests/tar/frontcontroller21.phar.phpt index ff9353ab8e..c1a299cc9b 100644 --- a/ext/phar/tests/tar/frontcontroller21.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller21.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller $_SERVER munging success tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -12,7 +12,7 @@ QUERY_STRING=test=hi --FILE_EXTERNAL-- files/frontcontroller12.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- string(10) "/index.php" string(10) "/index.php" diff --git a/ext/phar/tests/tar/frontcontroller3.phar.phpt b/ext/phar/tests/tar/frontcontroller3.phar.phpt index 75fede5444..06a4948f6b 100644 --- a/ext/phar/tests/tar/frontcontroller3.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller3.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller phps tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/tar/frontcontroller9.phar.phpt b/ext/phar/tests/tar/frontcontroller9.phar.phpt index 20bce784fe..247ebd4dc0 100644 --- a/ext/phar/tests/tar/frontcontroller9.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller9.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite array tar-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller3.phar.tar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/tar/open_for_write_existing.phpt b/ext/phar/tests/tar/open_for_write_existing.phpt index 641e5ce21d..13b327dd6a 100644 --- a/ext/phar/tests/tar/open_for_write_existing.phpt +++ b/ext/phar/tests/tar/open_for_write_existing.phpt @@ -27,7 +27,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index 54ec5855fb..39eb19e72d 100755 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; @@ -45,12 +45,11 @@ include $alias . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d -Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d This is b/c ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index 0e5a181e65..a4c839bd25 100755 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -28,7 +28,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; @@ -39,10 +39,9 @@ include $alias . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d This is b/c diff --git a/ext/phar/tests/tar/open_for_write_newfile.phpt b/ext/phar/tests/tar/open_for_write_newfile.phpt index 31e9d4a7e9..06fc394673 100644 --- a/ext/phar/tests/tar/open_for_write_newfile.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile.phpt @@ -27,7 +27,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index d3a21b4caf..34b942ca3d 100755 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; @@ -46,10 +46,9 @@ include $alias . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d This is b/c diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index 231241c8ad..736221d5ba 100755 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -28,7 +28,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -39,10 +39,9 @@ include $alias . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d This is b/c @@ -51,4 +50,4 @@ Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed t Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt index c990ff9b98..e9812cfb14 100755 --- a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt @@ -36,16 +36,16 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar.tar'); bool(true) bool(true) bool(false) -string(5) "Hello" +unicode(5) "Hello" string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " -string(5) "World" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " ===COMMIT=== bool(true) -string(5) "Hello" -string(5) "World" +unicode(5) "Hello" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " ===DONE=== diff --git a/ext/phar/tests/tar/phar_buildfromiterator5.phpt b/ext/phar/tests/tar/phar_buildfromiterator5.phpt index 600bd2ee5c..49e50b76c2 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator5.phpt @@ -54,6 +54,6 @@ __HALT_COMPILER(); rewind valid current -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid value (must return a string) ===DONE=== diff --git a/ext/phar/tests/tar/phar_buildfromiterator6.phpt b/ext/phar/tests/tar/phar_buildfromiterator6.phpt index e891a5d065..962d42036f 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator6.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid key (must return a string) ===DONE=== diff --git a/ext/phar/tests/tar/phar_buildfromiterator7.phpt b/ext/phar/tests/tar/phar_buildfromiterator7.phpt index d64c032d71..60d5cdd3d9 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator7.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" ===DONE=== diff --git a/ext/phar/tests/tar/phar_convert_phar.phpt b/ext/phar/tests/tar/phar_convert_phar.phpt index 7ce221991b..07fed09e3b 100644 --- a/ext/phar/tests/tar/phar_convert_phar.phpt +++ b/ext/phar/tests/tar/phar_convert_phar.phpt @@ -47,12 +47,12 @@ __HALT_COMPILER(); ?> --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=== diff --git a/ext/phar/tests/tar/phar_convert_phar2.phpt b/ext/phar/tests/tar/phar_convert_phar2.phpt index 03a6429d2a..58901ca7fc 100644 --- a/ext/phar/tests/tar/phar_convert_phar2.phpt +++ b/ext/phar/tests/tar/phar_convert_phar2.phpt @@ -49,14 +49,14 @@ __HALT_COMPILER(); ?> --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=== diff --git a/ext/phar/tests/tar/phar_convert_phar3.phpt b/ext/phar/tests/tar/phar_convert_phar3.phpt index f4768194d1..543c89b502 100644 --- a/ext/phar/tests/tar/phar_convert_phar3.phpt +++ b/ext/phar/tests/tar/phar_convert_phar3.phpt @@ -49,14 +49,14 @@ __HALT_COMPILER(); ?> --EXPECT-- bool(false) -int(6651) +int(6683) bool(true) string(60) "<?php // tar-based phar archive stub file __HALT_COMPILER();" bool(true) int(8192) -int(6651) +int(6683) bool(true) bool(true) -int(6651) +int(6683) ===DONE=== diff --git a/ext/phar/tests/tar/phar_stub.phpt b/ext/phar/tests/tar/phar_stub.phpt index e0d728f6f8..9069adb6f8 100644 --- a/ext/phar/tests/tar/phar_stub.phpt +++ b/ext/phar/tests/tar/phar_stub.phpt @@ -31,7 +31,7 @@ echo $phar->getStub(); $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phartmp.php'; $file = '<?php echo "third stub\n"; __HALT_COMPILER(); ?>'; $fp = fopen($fname3, 'wb'); -fwrite($fp, $file); +fwrite($fp, (binary)$file); fclose($fp); $fp = fopen($fname3, 'rb'); @@ -42,7 +42,7 @@ fclose($fp); echo $phar->getStub(); $fp = fopen($fname3, 'ab'); -fwrite($fp, 'booya'); +fwrite($fp, (binary)'booya'); fclose($fp); echo file_get_contents($fname3) . "\n"; diff --git a/ext/phar/tests/tar/phar_stub_error.phpt b/ext/phar/tests/tar/phar_stub_error.phpt index 5d35b932fe..7ab99b5689 100755 --- a/ext/phar/tests/tar/phar_stub_error.phpt +++ b/ext/phar/tests/tar/phar_stub_error.phpt @@ -16,11 +16,11 @@ $phar->setAlias('hio'); $phar['a'] = 'a'; $phar->stopBuffering(); -var_dump($stub); +var_dump((binary)$stub); var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); -$newstub = '<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>'; +$newstub = (binary)'<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>'; try { $phar->setStub($newstub); diff --git a/ext/phar/tests/tar/refcount1.phpt b/ext/phar/tests/tar/refcount1.phpt index c6808afb63..1c2c574c69 100644 --- a/ext/phar/tests/tar/refcount1.phpt +++ b/ext/phar/tests/tar/refcount1.phpt @@ -15,7 +15,7 @@ $alias = 'phar://' . $fname; $tar = new tarmaker($fname, 'none'); $tar->init(); -$tar->addFile('.phar/stub.php', "<?php __HALT_COMPILER(); ?>"); +$tar->addFile('.phar/stub.php', (binary)"<?php __HALT_COMPILER(); ?>"); $files = array(); @@ -31,7 +31,7 @@ foreach ($files as $n => $file) { $tar->close(); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, "extra"); +fwrite($fp, (binary)"extra"); fclose($fp); echo "===CLOSE===\n"; $phar = new Phar($fname); @@ -54,9 +54,9 @@ include $alias . '/b/c.php'; --EXPECTF-- ===CLOSE=== object(PharFileInfo)#%d (2) { - ["pathName":"SplFileInfo":private]=> + [u"pathName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.tar/b" - ["fileName":"SplFileInfo":private]=> + [u"fileName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.tar/b/c.php" } string(5) "extra" @@ -64,9 +64,9 @@ string(5) "extra" Warning: unlink(): phar error: "b/c.php" in phar "%srefcount1.phar.tar", has open file pointers, cannot unlink in %srefcount1.php on line %d object(PharFileInfo)#%d (2) { - ["pathName":"SplFileInfo":private]=> + [u"pathName":u"SplFileInfo":private]=> string(%d) "phar://%srefcount1.phar.tar/b" - ["fileName":"SplFileInfo":private]=> + [u"fileName":u"SplFileInfo":private]=> string(%s) "phar://%srefcount1.phar.tar/b/c.php" } string(5) "extra" diff --git a/ext/phar/tests/tar/tar_003.phpt b/ext/phar/tests/tar/tar_003.phpt index b390805dc3..e55f0c4533 100644 --- a/ext/phar/tests/tar/tar_003.phpt +++ b/ext/phar/tests/tar/tar_003.phpt @@ -14,7 +14,7 @@ $alias = 'phar://' . $fname; $tar = new tarmaker($fname, 'none'); $tar->init(); -$tar->addFile('.phar/stub.php', "<?php // tar-based phar archive stub file\n__HALT_COMPILER();"); +$tar->addFile('.phar/stub.php', (binary)"<?php // tar-based phar archive stub file\n__HALT_COMPILER();"); $tar->addFile('tar_003.phpt', $g = fopen(__FILE__, 'r')); $tar->addFile('internal/file/here', "hi there!\n"); $tar->mkDir('internal/dir'); diff --git a/ext/phar/tests/tar/tar_004.phpt b/ext/phar/tests/tar/tar_004.phpt index 2dd7ba169f..5fa3639464 100644 --- a/ext/phar/tests/tar/tar_004.phpt +++ b/ext/phar/tests/tar/tar_004.phpt @@ -33,6 +33,6 @@ include $fname; @unlink(dirname(__FILE__) . '/tar_004.phar.tar'); ?> --EXPECTF-- -string(9) "it worked" -string(%d) "phar://%star_004.phar.tar/tar_004.php" +unicode(9) "it worked" +unicode(%d) "phar://%star_004.phar.tar/tar_004.php" ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/tar/tar_bz2.phpt b/ext/phar/tests/tar/tar_bz2.phpt index ad14541431..c08829797b 100644 --- a/ext/phar/tests/tar/tar_bz2.phpt +++ b/ext/phar/tests/tar/tar_bz2.phpt @@ -47,8 +47,8 @@ var_dump($phar2->isCompressed() == Phar::BZ2); @unlink(dirname(__FILE__) . '/tar_bz2.phar.tar'); ?> --EXPECTF-- -string(9) "it worked" -string(%d) "phar://%star_bz2.phar/tar_004.php" +unicode(9) "it worked" +unicode(%d) "phar://%star_bz2.phar/tar_004.php" bool(true) bool(true) ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/tar/tar_gzip.phpt b/ext/phar/tests/tar/tar_gzip.phpt index 8287ee7f06..1394f8acbc 100644 --- a/ext/phar/tests/tar/tar_gzip.phpt +++ b/ext/phar/tests/tar/tar_gzip.phpt @@ -44,8 +44,8 @@ var_dump($b->isCompressed() == Phar::GZ); @unlink(dirname(__FILE__) . '/tar_gzip.phar.tar'); ?> --EXPECTF-- -string(9) "it worked" -string(%d) "phar://%star_gzip.phar/tar_004.php" +unicode(9) "it worked" +unicode(%d) "phar://%star_gzip.phar/tar_004.php" bool(true) bool(true) ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/withphar_web.phpt b/ext/phar/tests/withphar_web.phpt index a082c35b44..e9fc104ee8 100644 --- a/ext/phar/tests/withphar_web.phpt +++ b/ext/phar/tests/withphar_web.phpt @@ -11,6 +11,6 @@ PATH_INFO=/web.php --FILE_EXTERNAL-- files/nophar.phar --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- web diff --git a/ext/phar/tests/zip/all.phpt b/ext/phar/tests/zip/all.phpt index 84bbfc36be..1351e3ea76 100644 --- a/ext/phar/tests/zip/all.phpt +++ b/ext/phar/tests/zip/all.phpt @@ -53,10 +53,10 @@ string(3) "hi3" bool(false) bool(true) bool(true) -string(6) "100444" +unicode(6) "100444" string(32) "<?php ok __HALT_COMPILER(); ?> " string(4) "hime" -string(8) "hi there" -string(6) "a meta" +unicode(8) "hi there" +unicode(6) "a meta" ===DONE=== diff --git a/ext/phar/tests/zip/frontcontroller10.phar.phpt b/ext/phar/tests/zip/frontcontroller10.phar.phpt index f337604041..56d16c2064 100644 --- a/ext/phar/tests/zip/frontcontroller10.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller10.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite array invalid zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller4.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 Status: 403 Access Denied --EXPECT-- <html> diff --git a/ext/phar/tests/zip/frontcontroller11.phar.phpt b/ext/phar/tests/zip/frontcontroller11.phar.phpt index 9bd4aa41c0..581e84e2a1 100644 --- a/ext/phar/tests/zip/frontcontroller11.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller11.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type extension is not a string zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller5.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.phar.php:2 Stack trace: diff --git a/ext/phar/tests/zip/frontcontroller12.phar.phpt b/ext/phar/tests/zip/frontcontroller12.phar.phpt index 7d84e89e81..504d037177 100644 --- a/ext/phar/tests/zip/frontcontroller12.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller12.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type unknown int zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller6.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.phar.php:2 Stack trace: diff --git a/ext/phar/tests/zip/frontcontroller13.phar.phpt b/ext/phar/tests/zip/frontcontroller13.phar.phpt index 03694fe81b..4b9e910a25 100644 --- a/ext/phar/tests/zip/frontcontroller13.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller13.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type not string/int zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller7.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.phar.php:2 Stack trace: diff --git a/ext/phar/tests/zip/frontcontroller15.phar.phpt b/ext/phar/tests/zip/frontcontroller15.phar.phpt index 321381c6e1..f6cd29a3c5 100644 --- a/ext/phar/tests/zip/frontcontroller15.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller15.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHPS zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller8.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/zip/frontcontroller16.phar.phpt b/ext/phar/tests/zip/frontcontroller16.phar.phpt index 9ee88161b2..d3f457bea6 100644 --- a/ext/phar/tests/zip/frontcontroller16.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller16.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller mime type override, Phar::PHP zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller8.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio1 diff --git a/ext/phar/tests/zip/frontcontroller2.phar.phpt b/ext/phar/tests/zip/frontcontroller2.phar.phpt index 3d64b29972..e143e79f3f 100644 --- a/ext/phar/tests/zip/frontcontroller2.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller2.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller PHP test zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,6 +12,6 @@ PATH_INFO=/a.php --FILE_EXTERNAL-- files/frontcontroller.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- hio diff --git a/ext/phar/tests/zip/frontcontroller21.phar.phpt b/ext/phar/tests/zip/frontcontroller21.phar.phpt index fe22ad766e..d0a16c5d99 100644 --- a/ext/phar/tests/zip/frontcontroller21.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller21.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller $_SERVER munging success zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -13,7 +13,7 @@ QUERY_STRING=test=hi --FILE_EXTERNAL-- files/frontcontroller12.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECTF-- string(10) "/index.php" string(10) "/index.php" diff --git a/ext/phar/tests/zip/frontcontroller3.phar.phpt b/ext/phar/tests/zip/frontcontroller3.phar.phpt index 2adcee47b5..88a8a2490d 100644 --- a/ext/phar/tests/zip/frontcontroller3.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller3.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller phps zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?> @@ -12,7 +12,7 @@ PATH_INFO=/a.phps --FILE_EXTERNAL-- files/frontcontroller.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/zip/frontcontroller9.phar.phpt b/ext/phar/tests/zip/frontcontroller9.phar.phpt index 0f3d36bd35..4f12c9cd43 100644 --- a/ext/phar/tests/zip/frontcontroller9.phar.phpt +++ b/ext/phar/tests/zip/frontcontroller9.phar.phpt @@ -1,7 +1,7 @@ --TEST-- Phar front controller rewrite array zip-based --INI-- -default_charset= +default_charset=UTF-8 --SKIPIF-- <?php if (!extension_loaded("phar")) die("skip"); ?> --ENV-- @@ -11,7 +11,7 @@ PATH_INFO=/hi --FILE_EXTERNAL-- files/frontcontroller3.phar.zip --EXPECTHEADERS-- -Content-type: text/html +Content-type: text/html; charset=UTF-8 --EXPECT-- <code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">function </span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span> diff --git a/ext/phar/tests/zip/metadata_write_commit.phpt b/ext/phar/tests/zip/metadata_write_commit.phpt index cf0945d153..4bc8c10095 100644 --- a/ext/phar/tests/zip/metadata_write_commit.phpt +++ b/ext/phar/tests/zip/metadata_write_commit.phpt @@ -64,8 +64,8 @@ NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) string(1) "a" @@ -77,9 +77,9 @@ NULL array(2) { [0]=> int(25) - ["foo"]=> - string(3) "bar" + [u"foo"]=> + unicode(3) "bar" } bool(true) -string(2) "hi" +unicode(2) "hi" ===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_existing.phpt b/ext/phar/tests/zip/open_for_write_existing.phpt index 94f85b4e3f..8d5e4fdc9d 100644 --- a/ext/phar/tests/zip/open_for_write_existing.phpt +++ b/ext/phar/tests/zip/open_for_write_existing.phpt @@ -26,7 +26,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; ?> diff --git a/ext/phar/tests/zip/open_for_write_existing_b.phpt b/ext/phar/tests/zip/open_for_write_existing_b.phpt index 347a1ce719..145f31aa89 100755 --- a/ext/phar/tests/zip/open_for_write_existing_b.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_b.phpt @@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; ?> @@ -42,11 +42,10 @@ include $alias . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_b.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d -Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d This is b/c -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_existing_c.phpt b/ext/phar/tests/zip/open_for_write_existing_c.phpt index b66a77b212..fb75a05364 100755 --- a/ext/phar/tests/zip/open_for_write_existing_c.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_c.phpt @@ -28,7 +28,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); $fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; ?> @@ -36,11 +36,10 @@ include $alias . '/b/c.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_existing_c.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d This is b/c -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_newfile.phpt b/ext/phar/tests/zip/open_for_write_newfile.phpt index c3782d4fd3..3a24ead659 100644 --- a/ext/phar/tests/zip/open_for_write_newfile.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile.phpt @@ -26,7 +26,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index 44ad7487fa..bf29990d66 100755 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt @@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) { set_error_handler("err_handler", E_RECOVERABLE_ERROR); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; @@ -45,10 +45,9 @@ include $alias . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d This is b/c diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index b664397a99..2a2a555e2d 100755 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt @@ -28,7 +28,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); $fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); +fwrite($fp, (binary)'extra'); fclose($fp); include $alias . '/b/c.php'; @@ -39,10 +39,9 @@ include $alias . '/b/new.php'; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- - Warning: fopen(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d -Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d +Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d This is b/c @@ -51,4 +50,4 @@ Warning: include(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed t Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt index 81cf4001c3..389454fbbe 100755 --- a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt @@ -49,16 +49,16 @@ unlink(dirname(__FILE__) . '/myfakestub.php'); bool(true) bool(true) bool(false) -string(5) "Hello" +unicode(5) "Hello" string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " -string(5) "World" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " ===COMMIT=== bool(true) -string(5) "Hello" -string(5) "World" +unicode(5) "Hello" +unicode(5) "World" string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> " string(93) "<?php var_dump("First resource"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?> diff --git a/ext/phar/tests/zip/phar_buildfromiterator5.phpt b/ext/phar/tests/zip/phar_buildfromiterator5.phpt index 450ada100d..ff5de2ba94 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator5.phpt @@ -54,6 +54,6 @@ __HALT_COMPILER(); rewind valid current -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid value (must return a string) ===DONE=== diff --git a/ext/phar/tests/zip/phar_buildfromiterator6.phpt b/ext/phar/tests/zip/phar_buildfromiterator6.phpt index 2dfb04dbf0..8897d5c355 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator6.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned an invalid key (must return a string) ===DONE=== diff --git a/ext/phar/tests/zip/phar_buildfromiterator7.phpt b/ext/phar/tests/zip/phar_buildfromiterator7.phpt index 16ba6d61b9..1775552481 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator7.phpt @@ -55,6 +55,6 @@ rewind valid current key -string(24) "UnexpectedValueException" +unicode(24) "UnexpectedValueException" Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" ===DONE=== diff --git a/ext/phar/tests/zip/phar_convert_phar.phpt b/ext/phar/tests/zip/phar_convert_phar.phpt index d511a0b36a..cad6d9fc7f 100644 --- a/ext/phar/tests/zip/phar_convert_phar.phpt +++ b/ext/phar/tests/zip/phar_convert_phar.phpt @@ -46,12 +46,12 @@ __HALT_COMPILER(); ?> --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===