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));
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 :
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");
}
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) {
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) {
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;
}
/* 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;
}
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);
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);
}
#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);
}
/* 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);
}
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);
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:
{
$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]);
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found<title>\\n </head>\\n <body>\\n <h1>404 - File \", $pt, \" Not Found</h1>\\n </body>\\n</html>\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '";
static const char newstub2[] = "';\nconst LEN = ";
- static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = fread($fp, 4));\n$m = '';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_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);
}
<?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';
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';
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 {
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
<?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();
<?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();
<?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);
<?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);
<?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();
<?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();
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
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'); ?>
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
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(); ?>";
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(); ?>";
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
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) {
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
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
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
+}
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
<?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"; ?>';
<?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"; ?>';
<?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"; ?>';
<?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\'; ?>';
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\'; ?>';
<?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();
$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"; ?>';
<?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\'; ?>';
<?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"; ?>';
<?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"; ?>';
?>
===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
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
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
<?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"; ?>';
<?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"; ?>';
<?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"; ?>';
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://');
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
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);
?>
<?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__));
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);
?>
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);
?>
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
$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();
date_default_timezone_set('UTC');
}
-$manifest = '';
+$manifest = (binary)'';
$glags = 0;
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;
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);
<?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
--TEST--
Phar front controller rewrite access denied
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--FILE_EXTERNAL--
files/frontcontroller4.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
Status: 403 Access Denied
--EXPECT--
<html>
--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--
--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:
--TEST--
Phar front controller mime type unknown int
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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:
--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--
--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:
--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--
--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>
--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--
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio1
--TEST--
Phar front controller PHP test
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--FILE_EXTERNAL--
files/frontcontroller.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio
--TEST--
Phar front controller $_SERVER munging success
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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"
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"
--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--
--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
--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--
--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"
--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--
--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
--TEST--
Phar front controller with extra path_info
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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"
--EXPECTHEADERS--
Content-type: application/octet-stream
--EXPECTF--
-<?php var_dump("hi");
\ No newline at end of file
+<?php var_dump("hi");
--TEST--
Phar front controller with no extension
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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
--TEST--
Phar front controller with huge file
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/plain
+Content-type: text/plain;charset=UTF-8
--EXPECT--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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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
--TEST--
Phar front controller phps
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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>
files/frontcontroller8.phar
--EXPECTF--
oops did not run
-%a
\ No newline at end of file
+%a
--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
--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
--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
--TEST--
Phar front controller with cwd
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
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--
<body>
<h1>404 - File /notfound.php Not Found</h1>
</body>
-</html>
\ No newline at end of file
+</html>
<body>
<h1>404 - File /index.php Not Found</h1>
</body>
-</html>
\ No newline at end of file
+</html>
--TEST--
Phar front controller rewrite array
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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>
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===
__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"
?>
===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===
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===
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===
<?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');
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"
<?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');
array(2) {
[0]=>
int(25)
- ["foo"]=>
- string(3) "bar"
+ [u"foo"]=>
+ unicode(3) "bar"
}
bool(true)
string(1) "a"
<?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');
array(2) {
[0]=>
int(25)
- ["foo"]=>
- string(3) "bar"
+ [u"foo"]=>
+ unicode(3) "bar"
}
bool(true)
string(1) "a"
array(2) {
[0]=>
int(25)
- ["foo"]=>
- string(3) "bar"
+ [u"foo"]=>
+ unicode(3) "bar"
}
bool(true)
===DONE===
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===
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===
<?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"; ?>';
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';
?>
<?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"; ?>';
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';
?>
--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===
<?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"; ?>';
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';
?>
--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===
<?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"; ?>';
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';
<?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"; ?>';
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';
--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
<?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"; ?>';
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';
--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===
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===
<?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===
--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===
__HALT_COMPILER();
?>
--EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Cannot write to archive - write operations restricted by INI setting
===DONE===
__HALT_COMPILER();
?>
--EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
RecursiveDirectoryIterator::__construct(1): failed to open dir: No such file or directory
===DONE===
__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===
__HALT_COMPILER();
?>
--EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Cannot write out phar archive, phar is read-only
===DONE===
__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===
rewind
valid
current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
===DONE===
valid
current
key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid key (must return a string)
===DONE===
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===
$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";
@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)
__HALT_COMPILER();
?>
--EXPECT--
-int(6659)
+int(6683)
string(200) "<?php
function __autoload($class)
{
$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';
$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';
bool(true)
bool(false)
bool(false)
-int(6659)
+int(6683)
NULL
================= convertToZip() =====================
bool(false)
$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';
$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';
$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';
$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';
unlink(dirname(__FILE__) . '/brandnewphar.phar');
?>
--EXPECT--
-int(6659)
+int(6683)
string(200) "<?php
function __autoload($class)
{
?>
===DONE===
--EXPECT--
-string(6659) "<?php
+string(6683) "<?php
$web = 'index.php';
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]);
__HALT_COMPILER(); ?>"
============================================================================
============================================================================
-string(6670) "<?php
+string(6694) "<?php
$web = 'index.php';
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]);
__HALT_COMPILER(); ?>"
============================================================================
============================================================================
-int(7050)
+int(7074)
============================================================================
============================================================================
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
============================================================================
============================================================================
============================================================================
-string(6672) "<?php
+string(6696) "<?php
$web = 'the/web.php';
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]);
__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===
<?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';
$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'));
$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';
%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===
mkdir($dir, 0777);
$fname = $dir . '/dotted_path.phar';
-$stub = Phar::createDefaultStub();
-$file = $stub;
+$file = (binary)Phar::createDefaultStub();
$files = array();
$files['a'] = 'this is a';
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
$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";
@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
<?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)
<?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';
string(1) "c"
string(1) "d"
bool(true)
-string(8) "hi there"
+unicode(8) "hi there"
bool(true)
NULL
bool(true)
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
<?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');
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"
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"
--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===
<?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';
<?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';
<?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';
<?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';
<?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';
$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'));
<?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';
$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'));
<?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';
$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"; ?>';
<?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';
<?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';
<?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';
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
?>
--EXPECT--
-string(6661) "<?php
+string(6685) "<?php
$web = 'index.php';
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]);
"
============================================================================
============================================================================
-string(6672) "<?php
+string(6696) "<?php
$web = 'index.php';
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]);
"
============================================================================
============================================================================
-string(6674) "<?php
+string(6698) "<?php
$web = 'the/web.php';
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]);
"
============================================================================
============================================================================
-int(7052)
+int(7076)
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
===DONE===
<?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';
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);
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');
fclose($fp);
$fp = fopen($fname2, 'ab');
-fwrite($fp, 'booya');
+fwrite($fp, (binary)'booya');
fclose($fp);
echo file_get_contents($fname2) . "\n";
// 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);
<?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();
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);
<?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();
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);
<?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();
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);
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()
--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)
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
<?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__));
<?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"; ?>';
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);
--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"
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"
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
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===
class corrupter extends tarmaker {
function close()
{
- fwrite($this->tmp, 'oopsie');
+ fwrite($this->tmp, (binary)'oopsie');
fclose($this->tmp);
}
}
\ No newline at end of file
$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));
}
}
}
*/
function close()
{
- fwrite($this->tmp, pack('a1024', ''));
+ fwrite($this->tmp, (binary)pack('a1024', ''));
fclose($this->tmp);
}
}
\ No newline at end of file
--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--
--FILE_EXTERNAL--
files/frontcontroller4.phar.tar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
Status: 403 Access Denied
--EXPECT--
<html>
--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--
--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:
--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--
--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:
--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--
--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:
--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--
--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>
--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--
--FILE_EXTERNAL--
files/frontcontroller8.phar.tar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio1
--TEST--
Phar front controller PHP test tar-based
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--FILE_EXTERNAL--
files/frontcontroller.phar.tar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio
--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--
--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"
--TEST--
Phar front controller phps tar-based
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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>
--TEST--
Phar front controller rewrite array tar-based
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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>
$phar->stopBuffering();
$fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
fclose($fp);
include $alias . '/b/c.php';
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';
--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===
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';
--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
$phar->stopBuffering();
$fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
fclose($fp);
include $alias . '/b/c.php';
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';
--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
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';
--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
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===
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===
rewind
valid
current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
===DONE===
valid
current
key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid key (must return a string)
===DONE===
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===
?>
--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===
?>
--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===
?>
--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===
$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');
echo $phar->getStub();
$fp = fopen($fname3, 'ab');
-fwrite($fp, 'booya');
+fwrite($fp, (binary)'booya');
fclose($fp);
echo file_get_contents($fname3) . "\n";
$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);
$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();
$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);
--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"
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"
$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');
@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
@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
@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
--FILE_EXTERNAL--
files/nophar.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
web
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===
--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--
--FILE_EXTERNAL--
files/frontcontroller4.phar.zip
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
Status: 403 Access Denied
--EXPECT--
<html>
--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"); ?>
--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:
--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"); ?>
--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:
--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"); ?>
--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:
--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"); ?>
--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>
--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"); ?>
--FILE_EXTERNAL--
files/frontcontroller8.phar.zip
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio1
--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"); ?>
--FILE_EXTERNAL--
files/frontcontroller.phar.zip
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio
--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"); ?>
--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"
--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"); ?>
--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>
--TEST--
Phar front controller rewrite array zip-based
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--ENV--
--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>
array(2) {
[0]=>
int(25)
- ["foo"]=>
- string(3) "bar"
+ [u"foo"]=>
+ unicode(3) "bar"
}
bool(true)
string(1) "a"
array(2) {
[0]=>
int(25)
- ["foo"]=>
- string(3) "bar"
+ [u"foo"]=>
+ unicode(3) "bar"
}
bool(true)
-string(2) "hi"
+unicode(2) "hi"
===DONE===
$phar->stopBuffering();
$fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
fclose($fp);
include $alias . '/b/c.php';
?>
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';
?>
--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===
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';
?>
--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===
$phar->stopBuffering();
$fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
fclose($fp);
include $alias . '/b/c.php';
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';
--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
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';
--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
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===
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(); ?>
rewind
valid
current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
===DONE===
valid
current
key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
Iterator myIterator returned an invalid key (must return a string)
===DONE===
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===
?>
--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===