]> granicus.if.org Git - php/commitdiff
- IS_UNICODE checks and conversions
authorSteph Fox <sfox@php.net>
Mon, 19 May 2008 19:05:42 +0000 (19:05 +0000)
committerSteph Fox <sfox@php.net>
Mon, 19 May 2008 19:05:42 +0000 (19:05 +0000)
- stub and creation file updates
- far too many test updates to think about

194 files changed:
ext/phar/phar_object.c
ext/phar/shortarc.php
ext/phar/stub.h
ext/phar/tests/008.phpt
ext/phar/tests/009.phpt
ext/phar/tests/010.phpt
ext/phar/tests/011.phpt
ext/phar/tests/012.phpt
ext/phar/tests/013.phpt
ext/phar/tests/014.phpt
ext/phar/tests/015.phpt
ext/phar/tests/015b.phpt
ext/phar/tests/016.phpt
ext/phar/tests/016b.phpt
ext/phar/tests/017.phpt
ext/phar/tests/018.phpt
ext/phar/tests/019.phpt
ext/phar/tests/019b.phpt
ext/phar/tests/019c.phpt
ext/phar/tests/020.phpt
ext/phar/tests/021.phpt
ext/phar/tests/022.phpt
ext/phar/tests/023.phpt
ext/phar/tests/024.phpt
ext/phar/tests/025.phpt
ext/phar/tests/026.phpt
ext/phar/tests/027.phpt
ext/phar/tests/028.phpt
ext/phar/tests/029.phpt
ext/phar/tests/030.phpt
ext/phar/tests/033.phpt
ext/phar/tests/033a.phpt
ext/phar/tests/badparameters.phpt
ext/phar/tests/delete.phpt
ext/phar/tests/delete_in_phar.phpt
ext/phar/tests/delete_in_phar_b.phpt
ext/phar/tests/delete_in_phar_confirm.phpt
ext/phar/tests/dir.phpt
ext/phar/tests/fgc_edgecases.phpt
ext/phar/tests/files/nophar.phar
ext/phar/tests/files/phar_oo_test.inc
ext/phar/tests/files/phar_test.inc
ext/phar/tests/fopen_edgecases2.phpt
ext/phar/tests/frontcontroller10.phpt
ext/phar/tests/frontcontroller11.phpt
ext/phar/tests/frontcontroller12.phpt
ext/phar/tests/frontcontroller13.phpt
ext/phar/tests/frontcontroller15.phpt
ext/phar/tests/frontcontroller16.phpt
ext/phar/tests/frontcontroller2.phpt
ext/phar/tests/frontcontroller21.phpt
ext/phar/tests/frontcontroller22.phpt
ext/phar/tests/frontcontroller23.phpt
ext/phar/tests/frontcontroller24.phpt
ext/phar/tests/frontcontroller25.phpt
ext/phar/tests/frontcontroller26.phpt
ext/phar/tests/frontcontroller27.phpt
ext/phar/tests/frontcontroller28.phpt
ext/phar/tests/frontcontroller29.phpt
ext/phar/tests/frontcontroller3.phpt
ext/phar/tests/frontcontroller30.phpt
ext/phar/tests/frontcontroller31.phpt
ext/phar/tests/frontcontroller32.phpt
ext/phar/tests/frontcontroller33.phpt
ext/phar/tests/frontcontroller34.phpt
ext/phar/tests/frontcontroller6.phpt
ext/phar/tests/frontcontroller8.phpt
ext/phar/tests/frontcontroller9.phpt
ext/phar/tests/include_path.phpt
ext/phar/tests/ini_set.phpt
ext/phar/tests/ini_set_off.phpt
ext/phar/tests/invalid_alias.phpt
ext/phar/tests/invalid_setstubalias.phpt
ext/phar/tests/metadata_read.phpt
ext/phar/tests/metadata_write.phpt
ext/phar/tests/metadata_write_commit.phpt
ext/phar/tests/mkdir.phpt
ext/phar/tests/mounteddir.phpt
ext/phar/tests/open_for_write_existing.phpt
ext/phar/tests/open_for_write_existing_b.phpt
ext/phar/tests/open_for_write_existing_c.phpt
ext/phar/tests/open_for_write_newfile.phpt
ext/phar/tests/open_for_write_newfile_b.phpt
ext/phar/tests/open_for_write_newfile_c.phpt
ext/phar/tests/opendir.phpt
ext/phar/tests/opendir_edgecases.phpt
ext/phar/tests/phar_begin_setstub_commit.phpt
ext/phar/tests/phar_buildfromdirectory1.phpt
ext/phar/tests/phar_buildfromdirectory2.phpt
ext/phar/tests/phar_buildfromdirectory3.phpt
ext/phar/tests/phar_buildfromiterator1.phpt
ext/phar/tests/phar_buildfromiterator3.phpt
ext/phar/tests/phar_buildfromiterator5.phpt
ext/phar/tests/phar_buildfromiterator6.phpt
ext/phar/tests/phar_buildfromiterator7.phpt
ext/phar/tests/phar_bz2.phpt
ext/phar/tests/phar_commitwrite.phpt
ext/phar/tests/phar_convert_again.phpt
ext/phar/tests/phar_convert_repeated.phpt
ext/phar/tests/phar_convert_tar.phpt
ext/phar/tests/phar_convert_tar2.phpt
ext/phar/tests/phar_convert_tar3.phpt
ext/phar/tests/phar_convert_zip.phpt
ext/phar/tests/phar_create_in_cwd.phpt
ext/phar/tests/phar_createdefaultstub.phpt
ext/phar/tests/phar_ctx_001.phpt
ext/phar/tests/phar_decompress.phpt
ext/phar/tests/phar_dotted_path.phpt
ext/phar/tests/phar_extract.phpt
ext/phar/tests/phar_gzip.phpt
ext/phar/tests/phar_isvalidpharfilename.phpt
ext/phar/tests/phar_metadata_read.phpt
ext/phar/tests/phar_metadata_write.phpt
ext/phar/tests/phar_offset_check.phpt
ext/phar/tests/phar_oo_001.phpt
ext/phar/tests/phar_oo_compressallbz2.phpt
ext/phar/tests/phar_oo_compressallgz.phpt
ext/phar/tests/phar_oo_compressed_001.phpt
ext/phar/tests/phar_oo_compressed_001b.phpt
ext/phar/tests/phar_oo_compressed_002.phpt
ext/phar/tests/phar_oo_compressed_002b.phpt
ext/phar/tests/phar_oo_getmodified.phpt
ext/phar/tests/phar_oo_iswriteable.phpt
ext/phar/tests/phar_oo_uncompressall.phpt
ext/phar/tests/phar_setalias.phpt
ext/phar/tests/phar_setalias2.phpt
ext/phar/tests/phar_setdefaultstub.phpt
ext/phar/tests/phar_stub.phpt
ext/phar/tests/phar_stub_error.phpt
ext/phar/tests/phar_stub_write.phpt
ext/phar/tests/phar_stub_write_file.phpt
ext/phar/tests/phar_unlinkarchive.phpt
ext/phar/tests/pharfileinfo_construct.phpt
ext/phar/tests/pharfileinfo_getcrc32.phpt
ext/phar/tests/readfile_edgecases.phpt
ext/phar/tests/refcount1.phpt
ext/phar/tests/rename.phpt
ext/phar/tests/tar/all.phpt
ext/phar/tests/tar/files/make_invalid_tar.php.inc
ext/phar/tests/tar/files/tarmaker.php.inc
ext/phar/tests/tar/frontcontroller10.phar.phpt
ext/phar/tests/tar/frontcontroller11.phar.phpt
ext/phar/tests/tar/frontcontroller12.phar.phpt
ext/phar/tests/tar/frontcontroller13.phar.phpt
ext/phar/tests/tar/frontcontroller15.phar.phpt
ext/phar/tests/tar/frontcontroller16.phar.phpt
ext/phar/tests/tar/frontcontroller2.phar.phpt
ext/phar/tests/tar/frontcontroller21.phar.phpt
ext/phar/tests/tar/frontcontroller3.phar.phpt
ext/phar/tests/tar/frontcontroller9.phar.phpt
ext/phar/tests/tar/open_for_write_existing.phpt
ext/phar/tests/tar/open_for_write_existing_b.phpt
ext/phar/tests/tar/open_for_write_existing_c.phpt
ext/phar/tests/tar/open_for_write_newfile.phpt
ext/phar/tests/tar/open_for_write_newfile_b.phpt
ext/phar/tests/tar/open_for_write_newfile_c.phpt
ext/phar/tests/tar/phar_begin_setstub_commit.phpt
ext/phar/tests/tar/phar_buildfromiterator5.phpt
ext/phar/tests/tar/phar_buildfromiterator6.phpt
ext/phar/tests/tar/phar_buildfromiterator7.phpt
ext/phar/tests/tar/phar_convert_phar.phpt
ext/phar/tests/tar/phar_convert_phar2.phpt
ext/phar/tests/tar/phar_convert_phar3.phpt
ext/phar/tests/tar/phar_stub.phpt
ext/phar/tests/tar/phar_stub_error.phpt
ext/phar/tests/tar/refcount1.phpt
ext/phar/tests/tar/tar_003.phpt
ext/phar/tests/tar/tar_004.phpt
ext/phar/tests/tar/tar_bz2.phpt
ext/phar/tests/tar/tar_gzip.phpt
ext/phar/tests/withphar_web.phpt
ext/phar/tests/zip/all.phpt
ext/phar/tests/zip/frontcontroller10.phar.phpt
ext/phar/tests/zip/frontcontroller11.phar.phpt
ext/phar/tests/zip/frontcontroller12.phar.phpt
ext/phar/tests/zip/frontcontroller13.phar.phpt
ext/phar/tests/zip/frontcontroller15.phar.phpt
ext/phar/tests/zip/frontcontroller16.phar.phpt
ext/phar/tests/zip/frontcontroller2.phar.phpt
ext/phar/tests/zip/frontcontroller21.phar.phpt
ext/phar/tests/zip/frontcontroller3.phar.phpt
ext/phar/tests/zip/frontcontroller9.phar.phpt
ext/phar/tests/zip/metadata_write_commit.phpt
ext/phar/tests/zip/open_for_write_existing.phpt
ext/phar/tests/zip/open_for_write_existing_b.phpt
ext/phar/tests/zip/open_for_write_existing_c.phpt
ext/phar/tests/zip/open_for_write_newfile.phpt
ext/phar/tests/zip/open_for_write_newfile_b.phpt
ext/phar/tests/zip/open_for_write_newfile_c.phpt
ext/phar/tests/zip/phar_begin_setstub_commit.phpt
ext/phar/tests/zip/phar_buildfromiterator5.phpt
ext/phar/tests/zip/phar_buildfromiterator6.phpt
ext/phar/tests/zip/phar_buildfromiterator7.phpt
ext/phar/tests/zip/phar_convert_phar.phpt

index a8805ab2b2b1f3f18dcd9136c0bb569459f11499..f910ec5f2b67e03f4e8281e8354130dcef5f05f0 100755 (executable)
@@ -635,7 +635,12 @@ PHP_METHOD(Phar, webPhar)
                        return;
                }
                switch (Z_TYPE_P(retval_ptr)) {
-                       case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+                       case IS_UNICODE:
+                               zval_unicode_to_string(retval_ptr TSRMLS_CC);
+                               /* break intentionally omitted */
+#endif
+                       case IS_STRING:
                                efree(entry);
                                if (fci.retval_ptr_ptr != &retval_ptr) {
                                        entry = estrndup(Z_STRVAL_PP(fci.retval_ptr_ptr), Z_STRLEN_PP(fci.retval_ptr_ptr));
@@ -831,7 +836,12 @@ PHP_METHOD(Phar, webPhar)
                                                RETURN_FALSE;
                                        }
                                        break;
-                               case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+                               case IS_UNICODE:
+                                       zval_unicode_to_string(*(val) TSRMLS_CC);
+                                       /* break intentionally omitted */
+#endif
+                               case IS_STRING:
                                        PHAR_SET_USER_MIME(PHAR_MIME_OTHER)
                                        break;
                                default :
@@ -884,10 +894,18 @@ PHP_METHOD(Phar, mungServer)
                        zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to retrieve array value in Phar::mungServer()");
                        return;
                }
+
+#if PHP_VERSION_ID >= 60000
+               if (Z_TYPE_PP(data) == IS_UNICODE) {
+                       zval_unicode_to_string(*(data) TSRMLS_CC);
+               }
+#endif
+
                if (Z_TYPE_PP(data) != IS_STRING) {
                        zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
                        return;
                }
+
                if (!php_self && Z_STRLEN_PP(data) == sizeof("PHP_SELF")-1 && !strncmp(Z_STRVAL_PP(data), "PHP_SELF", sizeof("PHP_SELF")-1)) {
                        if (SUCCESS != zend_hash_add_empty_element(&(PHAR_GLOBALS->phar_SERVER_mung_list), "PHP_SELF", sizeof("PHP_SELF")-1)) {
                                zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unable to add PHP_SELF to Phar::mungServer() list of values to mung");
@@ -1340,16 +1358,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
        }
        if (!value) {
                /* failure in get_current_data */
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned no value", ce->name);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned no value", ce->name);
                return ZEND_HASH_APPLY_STOP;
        }
        switch (Z_TYPE_PP(value)) {
-               case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+               case IS_UNICODE:
+                       zval_unicode_to_string(*(value) TSRMLS_CC);
+                       /* break intentionally omitted */
+#endif
+               case IS_STRING:
                        break;
-               case IS_RESOURCE :
+               case IS_RESOURCE:
                        php_stream_from_zval_no_verify(fp, value);
                        if (!fp) {
-                               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returned an invalid stream handle", ce->name);
+                               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returned an invalid stream handle", ce->name);
                                return ZEND_HASH_APPLY_STOP;
                        }
                        if (iter->funcs->get_current_key) {
@@ -1359,29 +1382,28 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
                                        return ZEND_HASH_APPLY_STOP;
                                }
 
-                               PHAR_STR(key, str_key);
-
                                if (key_type == HASH_KEY_IS_LONG) {
-                                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+                                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
                                        return ZEND_HASH_APPLY_STOP;
                                }
+                               PHAR_STR(key, str_key);
                                save = str_key;
                                if (str_key[str_key_len - 1] == '\0') str_key_len--;
                        } else {
-                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
                                return ZEND_HASH_APPLY_STOP;
                        }
                        close_fp = 0;
                        opened = (char *) estrndup(str, sizeof("[stream]") + 1);
                        goto after_open_fp;
-               case IS_OBJECT :
+               case IS_OBJECT:
                        if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) {
                                char *test = NULL;
                                zval dummy;
                                spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(*value TSRMLS_CC);
 
                                if (!base_len) {
-                                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ce->name);
+                                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name);
                                        return ZEND_HASH_APPLY_STOP;
                                }
                                switch (intern->type) {
@@ -1411,7 +1433,11 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
                                                goto phar_spl_fileinfo;
                                        case SPL_FS_INFO:
                                        case SPL_FS_FILE:
+#if PHP_VERSION_ID >= 60000
                                                fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC);
+#else
+                                               fname = expand_filepath(intern->file_name, NULL TSRMLS_CC);
+#endif
                                                fname_len = strlen(fname);
                                                save = fname;
                                                is_splfileinfo = 1;
@@ -1420,7 +1446,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
                        }
                        /* fall-through */
                default :
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid value (must return a string)", ce->name);
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid value (must return a string)", ce->name);
                        return ZEND_HASH_APPLY_STOP;
        }
 
@@ -1447,7 +1473,7 @@ phar_spl_fileinfo:
                                str_key_len--;
                        }
                } else {
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base);
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base);
                        if (save) {
                                efree(save);
                                efree(temp);
@@ -1462,22 +1488,21 @@ phar_spl_fileinfo:
                                return ZEND_HASH_APPLY_STOP;
                        }
 
-                       PHAR_STR(key, str_key);
-
                        if (key_type == HASH_KEY_IS_LONG) {
-                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
                                return ZEND_HASH_APPLY_STOP;
                        }
+                       PHAR_STR(key, str_key);
                        save = str_key;
                        if (str_key[str_key_len - 1] == '\0') str_key_len--;
                } else {
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
                        return ZEND_HASH_APPLY_STOP;
                }
        }
 #if PHP_MAJOR_VERSION < 6
        if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that safe mode prevents opening", ce->name, fname);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name, fname);
                if (save) {
                        efree(save);
                }
@@ -1489,7 +1514,7 @@ phar_spl_fileinfo:
 #endif
 
        if (php_check_open_basedir(fname TSRMLS_CC)) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that open_basedir prevents opening", ce->name, fname);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name, fname);
                if (save) {
                        efree(save);
                }
@@ -1502,7 +1527,7 @@ phar_spl_fileinfo:
        /* try to open source file, then create internal phar file and copy contents */
        fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened);
        if (!fp) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a file that could not be opened \"%s\"", ce->name, fname);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a file that could not be opened \"%s\"", ce->name, fname);
                if (save) {
                        efree(save);
                }
@@ -3789,6 +3814,11 @@ PHP_METHOD(Phar, extractTo)
                switch (Z_TYPE_P(zval_files)) {
                        case IS_NULL:
                                goto all_files;
+#if PHP_VERSION_ID >= 60000
+                       case IS_UNICODE:
+                               zval_unicode_to_string(zval_files TSRMLS_CC);
+                               /* break intentionally omitted */
+#endif
                        case IS_STRING:
                                filename = Z_STRVAL_P(zval_files);
                                filename_len = Z_STRLEN_P(zval_files);
@@ -3802,6 +3832,11 @@ PHP_METHOD(Phar, extractTo)
                                        zval **zval_file;
                                        if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) {
                                                switch (Z_TYPE_PP(zval_file)) {
+#if PHP_VERSION_ID >= 60000
+                                                       case IS_UNICODE:
+                                                               zval_unicode_to_string(*(zval_file) TSRMLS_CC);
+                                                               /* break intentionally omitted */
+#endif
                                                        case IS_STRING:
                                                                break;
                                                        default:
index 748afeda2e2e40bb865e4ebbf519238f4426f0d4..1bf3baa8aa17b792669ab50e74fcd286c05fce26 100644 (file)
@@ -114,15 +114,15 @@ class Extract_Phar
     {
         $fp = fopen(__FILE__, 'rb');
         fseek($fp, self::LEN);
-        $L = unpack('V', $a = fread($fp, 4));
-        $m = '';
+        $L = unpack('V', $a = (binary)fread($fp, 4));
+        $m = (binary)'';
 
         do {
             $read = 8192;
             if ($L[1] - strlen($m) < 8192) {
                 $read = $L[1] - strlen($m);
             }
-            $last = fread($fp, $read);
+            $last = (binary)fread($fp, $read);
             $m .= $last;
         } while (strlen($last) && strlen($m) < $L[1]);
 
index 104a8baa639e85dca23c109de623d28d502cc358..2a1cbe6c09627539de04ca4b4ba5e0d30288d775 100644 (file)
@@ -24,10 +24,11 @@ static inline void phar_get_stub(const char *index_php, const char *web, size_t
        static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
        static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<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);
 }
index 664ffea5cb49b1365012b4da1ab72b4437331b4b..366a4c6d6d5d233afaf3f7f1559fff6721dbfa7d 100644 (file)
@@ -4,10 +4,10 @@ Phar::mapPhar truncated manifest (not enough for manifest length)
 <?php if (!extension_loaded("phar")) die("skip");?>
 --FILE--
 <?php
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
-$file .= pack('V', 500) . 'notenough';
+$file .= pack('V', 500) . (binary)'notenough';
 file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
 try {
 include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
index c80445d61b484e90935050d92fa111b8fa2a3062..42bdf1d1e7e0d8cc5e041b019ef576bf052a9785 100644 (file)
@@ -6,10 +6,10 @@ Phar::mapPhar too many manifest entries
 phar.require_hash=0
 --FILE--
 <?php
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
-$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . str_repeat('A', 500);
+$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . (binary)str_repeat('A', 500);
 file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
 try {
 include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
index bfeb435362adcc533458d5216198837684742a24..aff6d694d933bb1a7f4bef63a199cdf9f4cd8228 100644 (file)
@@ -6,14 +6,14 @@ Phar::mapPhar buffer overrun
 phar.require_hash=0
 --FILE--
 <?php
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
 // this fails because the manifest length does not include the other 10 byte manifest data
 
-$manifest = pack('V', 1) . 'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0);
-$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . 'hio' . pack('V', 0) . $manifest;
+$manifest = pack('V', 1) . (binary)'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0);
+$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . (binary)'hio' . pack('V', 0) . (binary)$manifest;
 
 file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
 try {
index 8e76bdce1571e9e7be2de69461c1f029336b65e9..a0f5b2d8498e5488c30291d21ba66b4ee6f1ff60 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 3246eff468ac36a0567a43e5ef3564b5df563395..f079d77c8f23460970a6300344fb7b1e85998e30 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index ae3ae72936423d16e4bc4e4d4b7a81e3e299e4c1..02c53b802f68ed81facc6580b2ef57cc39fa48d4 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 // filesize should be 1, and is 2
 
 $files = array();
index 1a20086ffa055d23fb1aa3aec089afbfe0670b79..7866c08af2a33e4fbf58d1319ef2f22a3a5a09f2 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 // wrong crc32
 
 $files = array();
index b93b77e9fbc0cda6a5c406a2fe362b6a01e04890..a8425205fa072daa9cf7d116fa7f0afb62011cf8 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont'=>'a','comp'=>chr(75) . chr(4) . chr(0) /* 'a' gzdeflated */, 'flags'=>0x00001000);
index 08ead2d9c006f50cebba0d43aac81a0a90248616..e2578bf6499eb74d0af0e5612fc2825d5668650a 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont'=>'Hello World', 'comp'=>pack('H*', '425a6834314159265359065c89da0000009780400000400080060490002000310c082031a916c41d41e2ee48a70a1200cb913b40'),'flags'=>0x00002000);
index 302d06d3cb3d1d2ac49c547c563440c0e87431ba..7fbcb80e0712ed66b5e2edff6cbd51403683ea9b 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 // file length is too short
 
 $files = array();
index 8fe66826d6d37de84aecebbd2de6d6da2221fac3..e38768831453f7b4bf78caa4f6c0a1818576bd1c 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 // file length is too short
 
 $files = array();
index ec012eaa113c6830e5dc171dedefbb619a131280..0915708ebcd26ee7a346275afdc0f9df53a793ba 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 97cd323779b8e2a138dcb85d79a4a59ba72bc36c..320356fd4dc1ba6c9a845d52a4938cc36ead976d 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
@@ -19,10 +19,12 @@ include 'files/phar_test.inc';
 
 include $fname;
 $dir = opendir('phar://hio/');
+
 while (false !== ($a = readdir($dir))) {
        var_dump($a);
        var_dump(is_dir('phar://hio/' . $a));
 }
+
 ?>
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
index 3d00b5f8e913422adf436e86354bbae1a6becd78..f9cff347efd049b6acba5151bfc91882becf3349 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 574919b79388133924f4fa6bd53f45ac05dd87d9..e3d1f7672dccd486cabed7fc332e53a5123b5ae1 100755 (executable)
@@ -2,13 +2,14 @@
 Phar: opendir test, recurse into
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?>
 --INI--
 phar.require_hash=0
 --FILE--
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 242b6668712ab05770a599c5d22eba1739291e92..ed5527e1c3f5ecc7bbd6cfe674cc08a659da5e45 100755 (executable)
@@ -2,13 +2,14 @@
 Phar: opendir test, recurse into
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?>
 --INI--
 phar.require_hash=0
 --FILE--
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index b06cdbf7312f0ba11ca6abcaab9957189749f996..4587d5210b6fb6709f54933fa990b019e839eb05 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
@@ -53,31 +53,31 @@ array(26) {
   int(-1)
   [12]=>
   int(-1)
-  ["dev"]=>
+  [u"dev"]=>
   int(12)
-  ["ino"]=>
+  [u"ino"]=>
   int(%d)
-  ["mode"]=>
+  [u"mode"]=>
   int(33060)
-  ["nlink"]=>
+  [u"nlink"]=>
   int(1)
-  ["uid"]=>
+  [u"uid"]=>
   int(0)
-  ["gid"]=>
+  [u"gid"]=>
   int(0)
-  ["rdev"]=>
+  [u"rdev"]=>
   int(-1)
-  ["size"]=>
+  [u"size"]=>
   int(1)
-  ["atime"]=>
+  [u"atime"]=>
   int(%d)
-  ["mtime"]=>
+  [u"mtime"]=>
   int(%d)
-  ["ctime"]=>
+  [u"ctime"]=>
   int(%d)
-  ["blksize"]=>
+  [u"blksize"]=>
   int(-1)
-  ["blocks"]=>
+  [u"blocks"]=>
   int(-1)
 }
 array(26) {
@@ -107,30 +107,30 @@ array(26) {
   int(-1)
   [12]=>
   int(-1)
-  ["dev"]=>
+  [u"dev"]=>
   int(12)
-  ["ino"]=>
+  [u"ino"]=>
   int(%d)
-  ["mode"]=>
+  [u"mode"]=>
   int(16749)
-  ["nlink"]=>
+  [u"nlink"]=>
   int(1)
-  ["uid"]=>
+  [u"uid"]=>
   int(0)
-  ["gid"]=>
+  [u"gid"]=>
   int(0)
-  ["rdev"]=>
+  [u"rdev"]=>
   int(-1)
-  ["size"]=>
+  [u"size"]=>
   int(0)
-  ["atime"]=>
+  [u"atime"]=>
   int(%d)
-  ["mtime"]=>
+  [u"mtime"]=>
   int(%d)
-  ["ctime"]=>
+  [u"ctime"]=>
   int(%d)
-  ["blksize"]=>
+  [u"blksize"]=>
   int(-1)
-  ["blocks"]=>
+  [u"blocks"]=>
   int(-1)
 }
\ No newline at end of file
index 9c9cd97568851af39376eef7a5c512dcb165bbc0..a0d74fb2fe2e842ec0abd0edca7d0f96e5c5d2d8 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
@@ -56,30 +56,30 @@ array(26) {
   int(-1)
   [12]=>
   int(-1)
-  ["dev"]=>
+  [u"dev"]=>
   int(12)
-  ["ino"]=>
+  [u"ino"]=>
   int(%d)
-  ["mode"]=>
+  [u"mode"]=>
   int(33060)
-  ["nlink"]=>
+  [u"nlink"]=>
   int(1)
-  ["uid"]=>
+  [u"uid"]=>
   int(0)
-  ["gid"]=>
+  [u"gid"]=>
   int(0)
-  ["rdev"]=>
+  [u"rdev"]=>
   int(-1)
-  ["size"]=>
+  [u"size"]=>
   int(1)
-  ["atime"]=>
+  [u"atime"]=>
   int(%d)
-  ["mtime"]=>
+  [u"mtime"]=>
   int(%d)
-  ["ctime"]=>
+  [u"ctime"]=>
   int(%d)
-  ["blksize"]=>
+  [u"blksize"]=>
   int(-1)
-  ["blocks"]=>
+  [u"blocks"]=>
   int(-1)
-}
\ No newline at end of file
+}
index 20c24a021436f27be10584a98ea717ee47a7cebd..4c02d6342c6847108aabb84700b089615e4433f6 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 808f91deaeff0569b4bfcb0eb9ae5f101d200dff..205b1ed57cafb0a6d92a05ce54888cfecf07ab23 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
index ad30d2644d53cd2d5aa75fd9bb99339005f56262..3bf0b5f0087d8b027bc46c3d7bc2e70440c16f77 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
index bbb5bc4e83cd5c78c6bfe4c9cc08920fbe3c065c..8ad434a5c446085598bea892d1bb16694baf6aa4 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = '<?php echo "This is a\n"; ?>';
index 696fbcf415ad6024e5b224bcf52ed61646a6914b..16a4d875546d5a8239c4a6f57167f2514727524d 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; require \''.$pname.'/b.php\'; ?>';      
index 679fefc2cd0bd4dd82e24b4179458ed4820c64b4..0bc36f4f6d2b037fed058cac119475f9ef195a88 100755 (executable)
@@ -2,13 +2,14 @@
 Phar: phar:// opendir
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!version_compare(phpversion(), 6, '<')) die("skip: permanent loop FIXME"); ?>
 --INI--
 phar.require_hash=0
 --FILE--
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; require \''.$pname.'/b.php\'; ?>';      
index 087f822777fd9d624658af37bd72d34a0251afa9..a49e9389424d7c04fc1c5a55b482c67ac90985d7 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://hio';
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 $alias = '';
 
 $files = array();
index 41fcec03e7fd66a1789cb3f6f5bb2466e320867c..4005e940963eca3097f34cb3d69069a7a08aa65e 100755 (executable)
@@ -11,7 +11,7 @@ $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
 $fname = $fname1;
 $alias = '';
 $pname = 'phar://hio';
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';      
index e1e94dba80da4ea62d7094cc736e87df68dd6a40..806da2c51ea9418c3cbf9a8f95820fea0052ef16 100755 (executable)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; include \''.$pname.'/b.php\'; ?>';
index d53c7f52fa8795a740238861f5c17be26da3e32f..5536c4d3c1a8c03611373412de8eabeee11c7fdc 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php';
 $pname = 'phar://hio';
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
index e8725bdda635c8b5ed25470ac8a2aaa02cc97c69..13067b4506f5193802bebd3eccbeab7f63bc00d2 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php';
 $pname = 'phar://hio';
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
index c644424d25a304945403591b2d4a1fff07021d8c..9d331652f74d1395ec323400afdd35a74f7403ec 100644 (file)
@@ -134,35 +134,35 @@ echo $e->getMessage() . "\n";
 ?>
 ===DONE===
 --EXPECTF--
-Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d
+Warning: Phar::mungServer() expects parameter 1 to be array, Unicode string given in %sbadparameters.php on line %d
 
-Warning: Phar::createDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::createDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
-Warning: Phar::loadPhar() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::loadPhar() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
-Warning: Phar::canCompress() expects parameter 1 to be long, string given in %sbadparameters.php on line %d
+Warning: Phar::canCompress() expects parameter 1 to be long, Unicode string given in %sbadparameters.php on line %d
 
-Warning: Phar::__construct() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::__construct() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
 Warning: Phar::convertToExecutable() expects parameter 1 to be long, array given in %sbadparameters.php on line %d
 
 Warning: Phar::convertToData() expects parameter 1 to be long, array given in %sbadparameters.php on line %d
 
-Warning: PharData::delete() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: PharData::delete() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 Cannot write out phar archive, phar is read-only
 Entry oops does not exist and cannot be deleted
 %sfiles/frontcontroller10.phar
 Cannot write out phar archive, phar is read-only
 A Phar alias cannot be set in a plain tar archive
 
-Warning: Phar::setAlias() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setAlias() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 Cannot change stub, phar is read-only
 A Phar stub cannot be set in a plain tar archive
 
-Warning: Phar::setStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 A Phar stub cannot be set in a plain tar archive
 
-Warning: Phar::setDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 Cannot change stub: phar.readonly=1
 Cannot set signature algorithm, phar is read-only
 Cannot set signature algorithm, not possible with tar-based phar archives
@@ -177,18 +177,18 @@ Phar is readonly, cannot change compression
 Warning: Phar::copy() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
 Cannot copy "a" to "b", phar is read-only
 
-Warning: Phar::offsetExists() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::offsetExists() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
-Warning: Phar::offsetGet() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::offsetGet() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
 Warning: Phar::offsetSet() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
 
-Warning: PharData::offsetUnset() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: PharData::offsetUnset() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 Write operations disabled by INI setting
 
-Warning: Phar::addEmptyDir() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::addEmptyDir() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
-Warning: Phar::addFile() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::addFile() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
 
 Warning: Phar::addFromString() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
 Write operations disabled by INI setting
index 1d985090645f042e6ad722e8cc6f8076210b14e4..6c97898dfdc4fdb74e1c3b7118c96d2963243fcc 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 4842d27913313027c4e05db7b303add81b70127e..adbb95ef7ae6b0c76e155042249ba047782d3666 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
index d26f51cbf1408f672543d18d2130933609e3be76..97ee4a12ae8c847fdfc8f2d6b5433f94f81c7ab9 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
index 13a8d0db298935b6c424ae76ab481da6176351d4..360b79a87510fbf56ea14222ddff64610269f0fe 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
index a8f9d3f889bde88bb5d525fdfa3ebf621316bf22..716d5f784621d49ab79d0f77ebe3a1980f7a049b 100644 (file)
@@ -37,7 +37,7 @@ mkdir('phar://' . dirname(__FILE__) . '/ok.phar/fails');
 file_put_contents('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt', 'hi');
 mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub');
 mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt');
-file_put_contents(dirname(__FILE__) . '/oops.phar', '<?php this should screw em up __HALT_COMPILER();');
+file_put_contents(dirname(__FILE__) . '/oops.phar', (binary)'<?php this should screw em up __HALT_COMPILER();');
 mkdir('phar://' . dirname(__FILE__) . '/oops.phar/fails');
 
 mkdir('phar://');
@@ -72,7 +72,7 @@ Warning: mkdir(): phar error: cannot create directory "fails" in phar "%sok.phar
 
 Warning: mkdir(): phar error: cannot create directory "sub" in phar "%sok.phar", directory already exists in %sdir.php on line %d
 
-Warning: mkdir(): phar error: cannot create directory "sub/directory.txt" in phar "%sok.phar", phar error: path "sub/directory.txt" exists and is 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
 
index e899604e95bfbc6b7d214f0b398897134fb45422..68bd4725c912f82bbab7c7a6feb3b9bfe70620e5 100644 (file)
@@ -27,7 +27,6 @@ echo file_get_contents("foob", true);
 echo file_get_contents("./hi", 0, $context);
 echo file_get_contents("../oops");
 echo file_get_contents("./hi", 0, $context, 50000);
-ini_set("magic_quotes_runtime", 1);
 echo file_get_contents("./hi");
 echo file_get_contents("./hi", 0, $context, 0, 0);
 ?>
@@ -40,7 +39,9 @@ include $pname . '/foo/hi';
 <?php rmdir(dirname(__FILE__) . '/poo'); ?>
 <?php unlink(dirname(__FILE__) . '/foob'); ?>
 --EXPECTF--
-Warning: file_get_contents() expects parameter 1 to be string, array given in %sfgc_edgecases.php on line %d
+Notice: Array to string conversion in %sfgc_edgecases.php on line %d
+
+Warning: file_get_contents(Array): failed to open stream: No such file or directory in %sfgc_edgecases.php on line %d
 blah
 <?php
 echo file_get_contents("foo/" . basename(__FILE__));
@@ -52,7 +53,6 @@ echo file_get_contents("foob", true);
 echo file_get_contents("./hi", 0, $context);
 echo file_get_contents("../oops");
 echo file_get_contents("./hi", 0, $context, 50000);
-ini_set("magic_quotes_runtime", 1);
 echo file_get_contents("./hi");
 echo file_get_contents("./hi", 0, $context, 0, 0);
 ?>
@@ -70,7 +70,6 @@ echo file_get_contents("foob", true);
 echo file_get_contents("./hi", 0, $context);
 echo file_get_contents("../oops");
 echo file_get_contents("./hi", 0, $context, 50000);
-ini_set("magic_quotes_runtime", 1);
 echo file_get_contents("./hi");
 echo file_get_contents("./hi", 0, $context, 0, 0);
 ?>
@@ -79,17 +78,16 @@ Warning: file_get_contents(phar://%sfgc_edgecases.phar.php/oops): failed to open
 
 Warning: file_get_contents(): Failed to seek to position 50000 in the stream in phar://%sfgc_edgecases.phar.php/foo/hi on line %d
 <?php
-echo file_get_contents(\"foo/\" . basename(__FILE__));
+echo file_get_contents("foo/" . basename(__FILE__));
 $context = stream_context_create();
-file_get_contents(\"./hi\", 0, $context, 0, -1);
-echo file_get_contents(\"foob\");
-set_include_path(\"%stests\");
-echo file_get_contents(\"foob\", true);
-echo file_get_contents(\"./hi\", 0, $context);
-echo file_get_contents(\"../oops\");
-echo file_get_contents(\"./hi\", 0, $context, 50000);
-ini_set(\"magic_quotes_runtime\", 1);
-echo file_get_contents(\"./hi\");
-echo file_get_contents(\"./hi\", 0, $context, 0, 0);
+file_get_contents("./hi", 0, $context, 0, -1);
+echo file_get_contents("foob");
+set_include_path("%stests");
+echo file_get_contents("foob", true);
+echo file_get_contents("./hi", 0, $context);
+echo file_get_contents("../oops");
+echo file_get_contents("./hi", 0, $context, 50000);
+echo file_get_contents("./hi");
+echo file_get_contents("./hi", 0, $context, 0, 0);
 ?>
 ===DONE===
\ No newline at end of file
index f1c52520182142d390dc88614a2160fad7a0a2bc..4eb3083c924aa6c5ca06071d6607ae6f5dd8c59e 100644 (file)
Binary files a/ext/phar/tests/files/nophar.phar and b/ext/phar/tests/files/nophar.phar differ
index 9863e8da9379ec35a2360f23968fdd24865de20b..e92b4444c1572869a3c7763e9f79c640c6f4a32b 100644 (file)
@@ -4,7 +4,7 @@ ini_set('date.timezone', 'GMT');
 
 $fname = dirname(__FILE__) . '/phar_oo_test.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 
index 0f989f9db11238c0cf01a1a402780c9001136e29..f82471d13b4cbeba7379448547db4bd1f918c44d 100644 (file)
@@ -4,7 +4,7 @@ if (function_exists('date_default_timezone_set')) {
        date_default_timezone_set('UTC');
 }
 
-$manifest = '';
+$manifest = (binary)'';
 $glags = 0;
 
 foreach($files as $name => $cont)
@@ -40,8 +40,8 @@ foreach($files as $name => $cont)
        if (isset($meta)) $meta = serialize($meta);
 
        // write manifest entry
-       $manifest .= pack('V', strlen($name)) . $name;
-       $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, strlen($meta)) . $meta;
+       $manifest .= pack('V', strlen($name)) . (binary)$name;
+       $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, strlen($meta)) . (binary)$meta;
 
        // globals
        $gflags |= $flags;
@@ -51,12 +51,14 @@ foreach($files as $name => $cont)
 if (!isset($alias)) $alias = 'hio';
 
 if (isset($pmeta)) $pmeta = serialize($pmeta); else $pmeta = '';
-$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, $gflags, strlen($alias)) . $alias . pack('V', strlen($pmeta)) . $pmeta . $manifest;
+
+$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, $gflags, strlen($alias)) . (binary)$alias . pack('V', strlen($pmeta)) . (binary)$pmeta . $manifest;
+$file = (binary)$file;
 $file .= pack('V', strlen($manifest)) . $manifest;
 
 foreach($files as $cont)
 {
-       $file .= $cont;
+       $file .= (binary)$cont;
 }
 
 file_put_contents($fname, $file);
index 3579a2c2216a1756fe04f379e6689539af28204c..b8f33b40a382ba291377b83e6bf795379d6e0fc1 100644 (file)
@@ -35,7 +35,9 @@ include $pname . '/foo/hi';
 <?php rmdir(dirname(__FILE__) . '/poo'); ?>
 <?php unlink(dirname(__FILE__) . '/foob'); ?>
 --EXPECTF--
-Warning: fopen() expects parameter 1 to be string, array given in %sfopen_edgecases2.php on line %d
+Notice: Array to string conversion in %sfopen_edgecases2.php on line %d
+
+Warning: fopen(Array): failed to open stream: No such file or directory in %sfopen_edgecases2.php on line %d
 blah
 test
 
index de6775fbfc2229f054888b89746804370015350d..667d5c243cd4eab3f8f10da63da62b4c47d49808 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite access denied
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller4.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 Status: 403 Access Denied
 --EXPECT--
 <html>
index 51fffbe13cecf906dace04aee558df2dfa17ee32..06ba4254979d5d10a0934f07399e8dc339c570c4 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type extension is not a string
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller5.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.php:2
 Stack trace:
index 0c277b3a777c6b0b8adf39993590f779963b3e2f..956ea1c050be0d55424b14a7dcddfbb8d4da456f 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type unknown int
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller6.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.php:2
 Stack trace:
index 669857647d1dd2733f01f891a8c7aff7801062d5..717e56996fa84d1b3b76f520c5e2b318b26d40c8 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type not string/int
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller7.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.php:2
 Stack trace:
index daeb60954d082b4a038266cea6328e5318e7ccee..370098014d156ce0782ce2aa840d9b5fb2290992 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHPS
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index cefb40dcfa7be456e3518f484e28395c1ef42794..712af40bf3e8753f7a5e91519296f66e2a865dd7 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHP
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio1
 
index 085fe1440e96b3aada0bab28187bd0d6b8591fa2..d0744dea1dcde3bdc2005426fd26adca1d24a8e4 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller PHP test
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio
index 8d91ccb1b22d85fad2e641e3cdcd8abc4e4b44c8..d153520e56e02c966fa8cf40113d5ce8450cd878 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller $_SERVER munging success
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -12,7 +12,7 @@ QUERY_STRING=test=hi
 --FILE_EXTERNAL--
 files/frontcontroller12.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(10) "/index.php"
 string(10) "/index.php"
@@ -21,4 +21,4 @@ string(18) "/index.php?test=hi"
 string(32) "/frontcontroller21.php/index.php"
 string(22) "/frontcontroller21.php"
 string(%d) "%sfrontcontroller21.php"
-string(40) "/frontcontroller21.php/index.php?test=hi"
\ No newline at end of file
+string(40) "/frontcontroller21.php/index.php?test=hi"
index 5a96b979da2d0c7ddd16a4f014b00fccf65971f8..c6b74832df72324eda137990ce03a4162965534a 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller include from cwd test 1
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,10 +11,10 @@ PATH_INFO=/index.php
 --FILE_EXTERNAL--
 files/frontcontroller13.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
-string(4) "test"
-string(12) "oof/test.php"
+unicode(4) "test"
+unicode(12) "oof/test.php"
 
 Warning: include(./hi.php): failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d
 
index afc4ed164f6d04f17d95194ab6f1bd2a7adcd0ad..441eb701c2c2783afd8cd5b0648eb1c96fa4b73b 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with generic action router test
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi/there
 --FILE_EXTERNAL--
 files/frontcontroller14.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(9) "/hi/there"
-string(%d) "phar://%sfrontcontroller23.php/html/index.php"
\ No newline at end of file
+string(%d) "phar://%sfrontcontroller23.php/html/index.php"
index da4c83ce674e3b1de38efdc1325e6bb87ca9fc3a..5d94738ae7a92701e9146e04c678c1950654ad11 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with custom 404 php script
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/unknown/file
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
-My 404 is rawesome
\ No newline at end of file
+My 404 is rawesome
index 3bffc5d5c48a9473bdaa9e684684f0cfc5793099..80a0844f2ece66af12d4e042411826dbf718d492 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with extra path_info
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a1.phps/extra/stuff
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(42) "/frontcontroller25.php/a1.phps/extra/stuff"
-string(12) "/extra/stuff"
\ No newline at end of file
+string(12) "/extra/stuff"
index a8097b0886c96bb3cd0a0aeb96dad9912c571371..7d787ddf4941f8124913a89d9e299f099b6e686e 100644 (file)
@@ -11,4 +11,4 @@ files/frontcontroller8.phar
 --EXPECTHEADERS--
 Content-type: application/octet-stream
 --EXPECTF--
-<?php var_dump("hi");
\ No newline at end of file
+<?php var_dump("hi");
index 5eaa18c63f313510c6871547b2ce3c8842f4246a..21dd28d31dbc9be79dd02cbfed79a7f93a508017 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with no extension
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/noext
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/plain
+Content-type: text/plain;charset=UTF-8
 --EXPECTF--
-hi
\ No newline at end of file
+hi
index a9c3df27d3ecb85aae34ffbd2faaa6e820093ee9..577800885b1f20621d53dd94d0e149cfab52b645 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with huge file
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/bigfile.txt
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/plain
+Content-type: text/plain;charset=UTF-8
 --EXPECT--
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
index 49b5a718ae2eadf386a9d26b38ae101c20670d93..2d0f5b5c058f579b946cab2958c29e008fc7d562 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with fatal error in php file
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/fatalerror.phps
 --FILE_EXTERNAL--
 files/frontcontroller8.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
-Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1
\ No newline at end of file
+Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1
index 98ec0e96f42951d118d706405820b4a6ccc2ec2d..ac36485837bd32cc0eb6276bb3304b992b9a7014 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller phps
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index de6960c244482fc9933e864a13d18d5f450107c9..fd6088d05aaddf62a765e56cd1417f3a9711beb1 100644 (file)
@@ -9,4 +9,4 @@ REQUEST_URI=/huh?
 files/frontcontroller8.phar
 --EXPECTF--
 oops did not run
-%a
\ No newline at end of file
+%a
index b5d6835335ca44a6c17543f45ace64085bcd6240..a02c937b58da83b6bd9374e375997256babf4a32 100644 (file)
@@ -1,15 +1,15 @@
 --TEST--
 Phar front controller with invalid callback for rewrites
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
 SCRIPT_NAME=/frontcontroller31.php
 REQUEST_URI=/frontcontroller31.php
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller16.phar
 --EXPECT--
-phar error: invalid rewrite callback
\ No newline at end of file
+phar error: invalid rewrite callback
index 61d5c6aca407b284bf57c5442586997a47e677b4..3a43cc239a475dcf5e0884d669fac2452da374d5 100644 (file)
@@ -1,15 +1,15 @@
 --TEST--
 Phar front controller with valid callback that is not good
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
 SCRIPT_NAME=/frontcontroller32.php
 REQUEST_URI=/frontcontroller32.php
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller17.phar
 --EXPECTF--
-%ahar error: failed to call rewrite callback
\ No newline at end of file
+%ahar error: failed to call rewrite callback
index d8750b9934670c65f01624405ed0b5c306ccb4bf..91581f43af8461064d03eb22c1f483ea105b6824 100644 (file)
@@ -1,15 +1,15 @@
 --TEST--
 Phar front controller with valid callback that does not return any value
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
 SCRIPT_NAME=/frontcontroller33.php
 REQUEST_URI=/frontcontroller33.php
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller18.phar
 --EXPECTF--
-phar error: rewrite callback must return a string or false
\ No newline at end of file
+phar error: rewrite callback must return a string or false
index 4e0b0cd66148db3e0c8188c9f4306eba81181147..34a49ded4dfad3ced7326d5d805c9c968e0243b0 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller with cwd
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -9,7 +9,7 @@ SCRIPT_NAME=/frontcontroller34.php
 REQUEST_URI=/frontcontroller34.php/start/index.php
 PATH_INFO=/start/index.php
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller19.phar
 --EXPECT--
index 1a2cc2cd23d12324cdfeb332d93adfb60cedc3da..86af8a694cbbe8002582c47168c8d3d1157dc638 100644 (file)
@@ -18,4 +18,4 @@ Status: 404 Not Found
  <body>
   <h1>404 - File /notfound.php Not Found</h1>
  </body>
-</html>
\ No newline at end of file
+</html>
index 36e3206d66879080bcaf3a097b5111aefae22733..1e986661b2473fbccf0b1bc88980853aaa14f367 100644 (file)
@@ -18,4 +18,4 @@ Status: 404 Not Found
  <body>
   <h1>404 - File /index.php Not Found</h1>
  </body>
-</html>
\ No newline at end of file
+</html>
index a61644315ab7ef77343cef9ee16b012f8d80d888..c591879172086924c549156f6e66460acd355912 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite array
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,9 +11,9 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller3.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
 </span>
-</code>
\ No newline at end of file
+</code>
index 5f9462c260972bca411270a6a5f663c5e33f0d56..4041ae2c208d7d03d7d9884d9465d75ce558b6e9 100644 (file)
@@ -31,4 +31,4 @@ test/file1.php
 Warning: include(file2.php): failed to open stream: No such file or directory in %sinclude_path.php on line %d
 
 Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d
-===DONE===
\ No newline at end of file
+===DONE===
index 588cd4a74b90ef3550fb1e192ea111f7490553dd..253e0528cd6fc839875bcd63330ad66c59971491 100644 (file)
@@ -18,11 +18,11 @@ var_dump(ini_get('phar.readonly'));
 __HALT_COMPILER();
 ?>
 --EXPECT--
-string(1) "1"
-string(1) "1"
-string(1) "1"
-string(1) "1"
-string(1) "1"
-string(1) "1"
-string(1) "1"
-string(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
+unicode(1) "1"
index 7da07c5d8df3c8a5b265a93c667b305cffbcfee5..284644fe5fb2b45880a23755888923461257c102 100644 (file)
@@ -53,33 +53,33 @@ var_dump(ini_get('phar.readonly'));
 ?>
 ===DONE===
 --EXPECT--
-string(1) "0"
-string(1) "0"
-string(1) "1"
-string(1) "1"
+unicode(1) "0"
+unicode(1) "0"
+unicode(1) "1"
+unicode(1) "1"
 bool(true)
 yes
-string(1) "0"
-string(1) "0"
-string(3) "yes"
-string(3) "yes"
+unicode(1) "0"
+unicode(1) "0"
+unicode(3) "yes"
+unicode(3) "yes"
 bool(false)
 on
-string(1) "0"
-string(1) "0"
-string(2) "on"
-string(2) "on"
+unicode(1) "0"
+unicode(1) "0"
+unicode(2) "on"
+unicode(2) "on"
 bool(false)
 true
-string(1) "0"
-string(1) "0"
+unicode(1) "0"
+unicode(1) "0"
 bool(false)
-string(4) "true"
-string(4) "true"
+unicode(4) "true"
+unicode(4) "true"
 0
-string(4) "true"
-string(4) "true"
+unicode(4) "true"
+unicode(4) "true"
 bool(true)
-string(1) "0"
-string(1) "0"
+unicode(1) "0"
+unicode(1) "0"
 ===DONE===
index dc0c71ed11984390b9b0210a14a709a3dcac9c56..97ebe0fe1aaf4dd5fc473a713493ca9c2c4579cc 100644 (file)
@@ -42,4 +42,4 @@ Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
 Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"
 Invalid alias "hil;" specified for phar "%sinvalid_alias.phar"
 Invalid alias ":hil" specified for phar "%sinvalid_alias.phar"
-===DONE===
\ No newline at end of file
+===DONE===
index 04cb779ddb24fc2a60630aa896d67df4a8b6f85d..86fa6e7f787941ae043e6d0d202db814193ead95 100644 (file)
@@ -44,4 +44,4 @@ Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.t
 Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias
 Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub
 Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias
-===DONE===
\ No newline at end of file
+===DONE===
index c3d12d6fbd0dd73e3193ffc2ef12d0cbc8083708..6f6266c00ce19d7bcb99ae3548acd105d085bb3d 100644 (file)
@@ -8,7 +8,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont' => 'a');
@@ -41,18 +41,18 @@ string(1) "b"
 string(1) "c"
 string(1) "d"
 NULL
-string(8) "hi there"
+unicode(8) "hi there"
 array(2) {
   [0]=>
-  string(2) "hi"
+  unicode(2) "hi"
   [1]=>
-  string(5) "there"
+  unicode(5) "there"
 }
 array(2) {
-  ["hi"]=>
-  string(5) "there"
-  ["foo"]=>
-  string(3) "bar"
+  [u"hi"]=>
+  unicode(5) "there"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 string(1) "a"
 string(1) "b"
index 4b9930b693e259b1c0af6722c14bd3b65bd2b5b2..d2f8901ba4b61fb5319ff54dc77a04df07131542 100755 (executable)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont' => 'a');
@@ -51,8 +51,8 @@ NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 string(1) "a"
index 0d0a5e56adf4bd22d91b972730e28417c9801b2c..95c53db963f0981d0cdc113665c8044dfcdeac46 100755 (executable)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont' => 'a');
@@ -59,8 +59,8 @@ NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 string(1) "a"
@@ -72,8 +72,8 @@ NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 ===DONE===
index 45c1d4674f5b2d1d8be67c1b61a45ff12b8ecf3a..b3c70fb7a6fb5e58c3ee09abd2d3d8ff88cfc397 100644 (file)
@@ -44,4 +44,4 @@ Warning: rmdir(): phar error: cannot remove directory "" in phar "foo.phar", dir
 
 Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is a not a directory in %smkdir.php on line %d
 Cannot create a directory in magic ".phar" directory
-===DONE===
\ No newline at end of file
+===DONE===
index 51a42695d71c4ca51ede4e9b5798948fc72b5ac6..2f9ec44890f578acc8013cee1d36092acb30105f 100644 (file)
@@ -112,4 +112,4 @@ Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php f
 Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed
 Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed
 Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed
-===DONE===
\ No newline at end of file
+===DONE===
index 2a3ec8b8245a832489e1f15d73b7c6fe952f7bd4..5b7b128bd77815bd784e3c88cfa3a7c25a4dd68a 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 $fp = fopen($pname . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 ?>
index 6c3cd3e986828fbb6b714700fb50e229bdd0883f..83984eb2eb8569cf27b0483cad9f930fe799c537 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -24,7 +24,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($pname . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 ?>
@@ -32,11 +32,10 @@ include $pname . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d
 
-Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d
 This is b/c
-===DONE===
\ No newline at end of file
+===DONE===
index 9bbaaae92a003aaf5b54947e1670be3552dd2416..728b7591bc90533b9c6b188f26b5f26b05e71ab8 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 $fp = fopen($pname . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 ?>
@@ -26,11 +26,10 @@ include $pname . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
 This is b/c
-===DONE===
\ No newline at end of file
+===DONE===
index 13114072da0e6aa7643aeb6c5d99f3a269327630..fdccd16dbf94bc7ac6ad1f0f7a236f983902e832 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 $fp = fopen($pname . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 include $pname . '/b/new.php';
index 1c136ff1d52da41dc6dca7744238aa929a0ffe0a..9e340ad87fe57620473a17a156c3a12c8753bb6c 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -24,7 +24,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($pname . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 include $pname . '/b/new.php';
@@ -34,15 +34,14 @@ include $pname . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line 20
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
 This is b/c
 
-Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line 22
+Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d
 
 Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d
 
index 59b4339eb95dd817b5b1a1d88eccaa6f0a05936b..e3d82e579bc4b96e2696450520f2cd314bd9db0e 100755 (executable)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -18,7 +18,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 $fp = fopen($pname . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $pname . '/b/c.php';
 include $pname . '/b/new.php';
@@ -28,16 +28,15 @@ include $pname . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
 This is b/c
 
 Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d
 
-Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
+Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line 16
 
-===DONE===
\ No newline at end of file
+===DONE===
index 46ab7c9682f71fd74ccca88047e2ea4325e71ded..8d462e3fa05ff99f11d7960ef239ac092a2a8f8a 100644 (file)
@@ -39,4 +39,4 @@ phar url "phar://" is unknown in %sopendir.php on line %d
 
 Warning: opendir(phar://hi.phar): failed to open dir: phar error: invalid url or non-existent phar "phar://hi.phar"
 phar url "phar://hi.phar" is unknown in %sopendir.php on line %d
-===DONE===
\ No newline at end of file
+===DONE===
index d330d27ff37a1ed1eb0e649a9791f9cbae2d8123..6a5900485e8a04ac8c7af251bb65b6bcbf2543ce 100644 (file)
@@ -37,10 +37,12 @@ include $pname . '/foo';
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 <?php rmdir(dirname(__FILE__) . '/poo');
 --EXPECTF--
-Warning: opendir() expects parameter 1 to be string, array given in %sopendir_edgecases.php on line %d
+Notice: Array to string conversion in %sopendir_edgecases.php on line %d
+
+Warning: opendir(Array): failed to open dir: No such file or directory in %sopendir_edgecases.php on line %d
 .
 ..
 foo
 
 Warning: opendir(phar://%sopendir_edgecases.phar.php/oops): failed to open dir: %s in phar://%sopendir_edgecases.phar.php/foo on line %d
-===DONE===
\ No newline at end of file
+===DONE===
index d36865ddc566e386acfe1b459eb47f7ac978311d..f7ae55005287918ec6e6a6090f0974d31585f596 100755 (executable)
@@ -35,16 +35,16 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar');
 --EXPECT--
 bool(true)
 bool(false)
-string(5) "Hello"
+unicode(5) "Hello"
 string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
-string(5) "World"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 ===COMMIT===
 bool(true)
-string(5) "Hello"
-string(5) "World"
+unicode(5) "Hello"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 ===DONE===
index 505b15036f3ea34763087c070d5d2c9d74062448..060d66fbb86a11302f1b1edeb1276fc41119e14b 100644 (file)
@@ -23,6 +23,6 @@ unlink(dirname(__FILE__) . '/buildfromdirectory.phar');
 __HALT_COMPILER();
 ?>
 --EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Cannot write to archive - write operations restricted by INI setting
 ===DONE===
index fcad4725a7d1e33f8c41e1c5135ffe9d6ca8a15d..a306f749147f5a126f95b0b94821a920c8011650 100644 (file)
@@ -22,6 +22,6 @@ unlink(dirname(__FILE__) . '/buildfromdirectory.phar');
 __HALT_COMPILER();
 ?>
 --EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 RecursiveDirectoryIterator::__construct(1): failed to open dir: No such file or directory
 ===DONE===
index 435bbdfba6f26a8e3c0d0a652d2ef118e6a2ab60..a9f00987f35d91d6901b0710d2e6408def016cf5 100644 (file)
@@ -23,5 +23,5 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar');
 __HALT_COMPILER();
 ?>
 --EXPECTF--
-Warning: Phar::buildFromDirectory() expects parameter 2 to be string, object given in %sphar_buildfromdirectory3.php on line %d
+Warning: Phar::buildFromDirectory() expects parameter 2 to be binary string, object given in %sphar_buildfromdirectory3.php on line %d
 ===DONE===
index f75823f94c8c2fc744c9eae49fe9b36500ff6bda..460a405a45d105ef3860155d737306dd3c6f6956 100644 (file)
@@ -23,6 +23,6 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar');
 __HALT_COMPILER();
 ?>
 --EXPECT--
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Cannot write out phar archive, phar is read-only
 ===DONE===
index 5fca706041420661d3e984ca1b4b1a9874a09d08..93adf9fa6cc6aa187f68e3026cf3877bed16e9c0 100644 (file)
@@ -50,5 +50,5 @@ unlink(dirname(__FILE__) . '/buildfromiterator.phar');
 __HALT_COMPILER();
 ?>
 --EXPECTF--
-Warning: Phar::buildFromIterator() expects parameter 2 to be string, object given in %sphar_buildfromiterator3.php on line %d
+Warning: Phar::buildFromIterator() expects parameter 2 to be binary string, object given in %sphar_buildfromiterator3.php on line %d
 ===DONE===
index 3bd2cec78c1b201f556da3c16fd3b728688dfa3d..8f341ed2150996bd9ebbef89b41b7283d24122b2 100644 (file)
@@ -54,6 +54,6 @@ __HALT_COMPILER();
 rewind
 valid
 current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid value (must return a string)
 ===DONE===
index ae73bbd4794390dc51028a4cbdf8a12e0eb7f863..71083788c95ad74999d5804a657e6c37d1d36c22 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid key (must return a string)
 ===DONE===
index 38d2e1a5f23c7f09dad0efadf785cc80fe005abd..e717059488b05bbabd85c621e24eeb372c197061 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
 ===DONE===
index 71b10f909241faf214034ad3a7c7783cf58404a2..7380ea6fd1e1650ece23008f1fdf98d0ee39b4c5 100644 (file)
@@ -14,7 +14,7 @@ $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/phar_bz2.2.phar';
 $pname2 = 'phar://' . $fname2;
 
-$file = '<?php
+$file = (binary)'<?php
 Phar::mapPhar();
 var_dump("it worked");
 include "phar://" . __FILE__ . "/tar_004.php";
@@ -53,8 +53,8 @@ echo $e->getMessage(),"\n";
 @unlink(dirname(__FILE__) . '/phar_bz2.2.phar');
 ?>
 --EXPECTF--
-string(9) "it worked"
-string(%d) "phar://%sphar_bz2.phar/tar_004.php"
+unicode(9) "it worked"
+unicode(%d) "phar://%sphar_bz2.phar/tar_004.php"
 bool(true)
 bool(true)
 
index 447d1e8309e4c3294ae09418fb05216524a785f2..36d473e5c21a128ae8490e7c5cb9c011fab00859 100644 (file)
@@ -29,7 +29,7 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar');
 __HALT_COMPILER();
 ?>
 --EXPECT--
-int(6659)
+int(6683)
 string(200) "<?php
 function __autoload($class)
 {
index 4543a238d584c0a4205ae3089af515da66d15105..3b1e4a76a9f04d22d18225c1fdc9d1e3dac4c162 100644 (file)
@@ -13,8 +13,7 @@ phar.readonly=0
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '2.tbz';
 $pname = 'phar://' . $fname;
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index fe0888ebbf2b0bff6ab9479c11da89128c18574b..74c0ca493cd182ddffc5be5dda166e8a69991dd3 100644 (file)
@@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
 $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -123,7 +122,7 @@ NULL
 bool(true)
 bool(false)
 bool(false)
-int(6659)
+int(6683)
 NULL
 ================= convertToZip() =====================
 bool(false)
index d4031ec32f4c5efe3612ddea7fcc68b5c4624ef5..926b3ebc894e61846225f3bf87e88fa2379fa514 100644 (file)
@@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
 $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar';
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index f0f0f698258f91f89bb460ceede01ad566288844..5669701289edb525d1d885e946c9dc16714ef425 100644 (file)
@@ -13,8 +13,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar.gz';
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar';
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 52fd0f555a95a35a2e62020425130373a86247d9..fe71d5a0cd1005ab7ab52a2e3ff368b0526ee84b 100644 (file)
@@ -13,8 +13,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar';
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 734551ee9c2d34bd37b25dd71a327c5e24ea03c6..4dfa061817e73308d5420d78a404c1e2d6612b2a 100644 (file)
@@ -12,8 +12,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
 $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.zip';
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
-$file = $stub;
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index c4f74b6d6ca8590f4f31141b543c0b8e957b41b9..4b0e6594fb14d4baf30a21c4f76941507991708b 100644 (file)
@@ -32,7 +32,7 @@ __HALT_COMPILER();
 unlink(dirname(__FILE__) . '/brandnewphar.phar');
 ?>
 --EXPECT--
-int(6659)
+int(6683)
 string(200) "<?php
 function __autoload($class)
 {
index 642aac9accb505ce3ac49b2ce32aac295b94ff2e..abc9ad8e5b1570dbb8d173961098ebc9bdff5f38 100644 (file)
@@ -34,7 +34,7 @@ echo $e->getMessage() . "\n";
 ?>
 ===DONE===
 --EXPECT--
-string(6659) "<?php
+string(6683) "<?php
 
 $web = 'index.php';
 
@@ -144,21 +144,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'index.php';
-const LEN = 6661;
+const LEN = 6685;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -328,7 +328,7 @@ Extract_Phar::go();
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-string(6670) "<?php
+string(6694) "<?php
 
 $web = 'index.php';
 
@@ -438,21 +438,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6672;
+const LEN = 6696;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -622,7 +622,7 @@ Extract_Phar::go();
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-int(7050)
+int(7074)
 ============================================================================
 ============================================================================
 Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
@@ -630,7 +630,7 @@ Illegal filename passed in for stub creation, was 401 characters long, and only
 ============================================================================
 ============================================================================
 ============================================================================
-string(6672) "<?php
+string(6696) "<?php
 
 $web = 'the/web.php';
 
@@ -740,21 +740,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6674;
+const LEN = 6698;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -924,6 +924,6 @@ Extract_Phar::go();
 __HALT_COMPILER(); ?>"
 ============================================================================
 ============================================================================
-int(7050)
+int(7074)
 Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
 ===DONE===
index 13b4d6a7812161854c61104fc17c43d1ce6414aa..4244566eaf56348ccaca8995b627f41e03ec2376 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -31,9 +31,9 @@ var_dump($phar['c']->isCompressed());
 $context = stream_context_create(array('phar'=> array('compress'=>Phar::GZ, 'metadata' => array(2, 'hi' => 3))));
 $context2 = stream_context_create(array('phar' => array('metadata' => array(4))));
 
-file_put_contents($pname . '/a', 'new a', 0); // no compression
-file_put_contents($pname . '/b', 'new b', 0, $context);
-file_put_contents($pname . '/d', 'new d', 0, $context2);
+file_put_contents($pname . '/a', (binary)'new a', 0); // no compression
+file_put_contents($pname . '/b', (binary)'new b', 0, $context);
+file_put_contents($pname . '/d', (binary)'new d', 0, $context2);
 
 $phar = new Phar($fname);
 var_dump(file_get_contents($pname . '/a'));
index ae199eb03b8d43e304ae0f5830291376c629108f..0ec692dc09586d104103077fd98cd94926bdd41e 100644 (file)
@@ -11,7 +11,7 @@ phar.readonly=0
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '2.phar.gz';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -63,7 +63,7 @@ int(4096)
 %sphar_decompress.phar
 %sphar_decompress.hooba.phar
 
-Warning: Phar::decompress() expects parameter 1 to be string, array given in %sphar_decompress.php on line %d
+Warning: Phar::decompress() expects parameter 1 to be binary string, array given in %sphar_decompress.php on line %d
 Cannot decompress phar archive, phar is read-only
 Cannot decompress zip-based archives with whole-archive compression
 ===DONE===
index f6d626e6cf9fa6786c4bd696348f9260c1eb8527..8b88d0238967aec85274d316dd0b677924a747d5 100644 (file)
@@ -13,8 +13,7 @@ $dir = dirname(__FILE__) . '/broken.dirname';
 mkdir($dir, 0777);
 
 $fname = $dir . '/dotted_path.phar';
-$stub = Phar::createDefaultStub();
-$file = $stub;
+$file = (binary)Phar::createDefaultStub();
 
 $files = array();
 $files['a'] = 'this is a';
index 82e5f8d1918e8d4624b6c05c3e49f19131f24606..40d3df391dc5515ae87ba4d467e5515242172aeb 100644 (file)
@@ -119,7 +119,7 @@ string(3) "hi2"
 bool(false)
 Invalid argument, expected a filename (string) or array of filenames
 
-Warning: Phar::extractTo() expects parameter 1 to be string, array given in %sphar_extract.php on line %d
+Warning: Phar::extractTo() expects parameter 1 to be binary string, array given in %sphar_extract.php on line %d
 Invalid argument, extraction path must be non-zero length
 Unable to use path "%soops" for extraction, it is a file, must be a directory
 Invalid argument, array of filenames to extract contains non-string value
index f472949c0552c0c9a75ff1dad19763a7eb99aa8e..d026c45cba6202db200afd237a0415b3761e3c5e 100644 (file)
@@ -15,7 +15,7 @@ $pname = 'phar://' . $fname;
 $fname2 = dirname(__FILE__) . '/phar_gzip.2.phar';
 $pname2 = 'phar://' . $fname2;
 
-$file = '<?php
+$file = (binary)'<?php
 Phar::mapPhar();
 var_dump("it worked");
 include "phar://" . __FILE__ . "/tar_004.php";
@@ -47,8 +47,8 @@ var_dump($b->isCompressed() == Phar::GZ);
 @unlink(dirname(__FILE__) . '/phar_gzip.2.phar');
 ?>
 --EXPECTF--
-string(9) "it worked"
-string(%d) "phar://%sphar_gzip.phar/tar_004.php"
+unicode(9) "it worked"
+unicode(%d) "phar://%sphar_gzip.phar/tar_004.php"
 bool(true)
 bool(true)
 ===DONE===
\ No newline at end of file
index 9c953ee88a34315d22f794911098a8f1b5123718..294094824295eb5b83f0f803e32ebd55c77bf82b 100644 (file)
@@ -76,7 +76,7 @@ var_dump(Phar::isValidPharFilename('dir.phar.php', false));
 <?php
 rmdir(dirname(__FILE__) . '/.phar');
 --EXPECTF--
-Warning: Phar::isValidPharFilename() expects parameter 1 to be string, array given in %sphar_isvalidpharfilename.php on line %d
+Warning: Phar::isValidPharFilename() expects parameter 1 to be binary string, array given in %sphar_isvalidpharfilename.php on line %d
 *
 bool(false)
 bool(false)
index bda411f7402ed57a2a7135ade0777a7e657ee136..a0ee3fa7bd21d42bf33143fcc05b4b630a2b2165 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $pmeta = 'hi there';
@@ -53,7 +53,7 @@ string(1) "b"
 string(1) "c"
 string(1) "d"
 bool(true)
-string(8) "hi there"
+unicode(8) "hi there"
 bool(true)
 NULL
 bool(true)
@@ -72,19 +72,19 @@ NULL
 bool(true)
 array(2) {
   [0]=>
-  string(2) "hi"
+  unicode(2) "hi"
   [1]=>
-  string(5) "there"
+  unicode(5) "there"
 }
 bool(true)
 NULL
   meta d
 bool(true)
 array(2) {
-  ["hi"]=>
-  string(5) "there"
-  ["foo"]=>
-  string(3) "bar"
+  [u"hi"]=>
+  unicode(5) "there"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 NULL
index 6df7ba4faf658c89379466b686d5ecaebbfc4966..cbef9405fa9b602a936b01ea68347cfc4c0420de 100644 (file)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a'] = array('cont' => 'a');
@@ -52,16 +52,16 @@ string(1) "c"
 string(1) "d"
 NULL
 array(1) {
-  ["my"]=>
-  string(6) "friend"
+  [u"my"]=>
+  unicode(6) "friend"
 }
 int(42)
 NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 string(1) "a"
index 7e00d4b50e89bd5d756824f3566d754af24733f8..fe12534915d07e2fde28814b75d9c03125f7a96c 100644 (file)
@@ -70,8 +70,8 @@ var_dump($phar->getAlias());
 Entry .phar/stub.php does not exist
 Entry .phar/alias.txt does not exist
 Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub
-int(6661)
-int(6661)
+int(6685)
+int(6685)
 Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias
 string(5) "susan"
 string(5) "susan"
index 81d57d1bfc8422c988c10afe81c70eb91322c5d6..5f1a4e70cb68cc08f406c2c373cf198907b5d785 100755 (executable)
@@ -49,6 +49,6 @@ __halt_compiler();
 --EXPECT--
 string(5) "1.0.0"
 int(5)
-string(50) "Cannot call method on an uninitialized Phar object"
-string(29) "Cannot call constructor twice"
+unicode(50) "Cannot call method on an uninitialized Phar object"
+unicode(29) "Cannot call constructor twice"
 ===DONE===
index 3f52227194f0d9dd8231a6d286b326263a5950f5..eb5c67649790cd7210030d72f3a7946ae8859dfa 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 55e7435f95171b7a67be5a89062dad3972309583..74cac42536cd0efee4762eb06c5a8ce185da4475 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index af02012573e9d06dcd10d52980ae494406a2ef53..30d86bd90fbd2c2fb16c460e82930c2267dfb4f4 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 6d4c73286220bc0a17993bd077c5003ca8f19bab..a1bbd0bae296a03927190f250e6a253f9a6d69d9 100755 (executable)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index d03d6f1a989418f079f599ef672e0792031d5ad0..601a0fbfbd9b06e89fa30783d1d7bb40bae79db3 100755 (executable)
@@ -10,7 +10,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -30,10 +30,10 @@ var_dump($phar['c']->isCompressed());
 
 $context = stream_context_create(array('phar'=>array('compress'=>Phar::GZ)));
 
-file_put_contents($pname . '/b', 'new b');
-file_put_contents($pname . '/c', 'new c', 0, $context);
-file_put_contents($pname . '/d', 'new d');
-file_put_contents($pname . '/e', 'new e', 0, $context);
+file_put_contents($pname . '/b', (binary)'new b');
+file_put_contents($pname . '/c', (binary)'new c', 0, $context);
+file_put_contents($pname . '/d', (binary)'new d');
+file_put_contents($pname . '/e', (binary)'new e', 0, $context);
 
 $phar = new Phar($fname);
 var_dump(file_get_contents($pname . '/a'));
index 0e167012b7681485861aa8608518ccc1155185a3..28dd6c4c84ac1ee23656aa1214aaf18288a2a8fa 100755 (executable)
@@ -10,7 +10,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -30,10 +30,10 @@ var_dump($phar['c']->isCompressed());
 
 $context = stream_context_create(array('phar'=>array('compress'=>Phar::BZ2)));
 
-file_put_contents($pname . '/b', 'new b');
-file_put_contents($pname . '/c', 'new c', 0, $context);
-file_put_contents($pname . '/d', 'new d');
-file_put_contents($pname . '/e', 'new e', 0, $context);
+file_put_contents($pname . '/b', (binary)'new b');
+file_put_contents($pname . '/c', (binary)'new c', 0, $context);
+file_put_contents($pname . '/d', (binary)'new d');
+file_put_contents($pname . '/e', (binary)'new e', 0, $context);
 
 $phar = new Phar($fname);
 var_dump(file_get_contents($pname . '/a'));
index d531393281bee674f34926e075393dd9fc69cd2f..d27c852d4943c4a9300e9ff0169f62cae0ff1a91 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 9fbca2c9eac884b0d91234a5d14ea8a8cf023b9f..8e61d900a014ac76e99ddabee2f280eaed64fb9e 100644 (file)
@@ -10,7 +10,7 @@ phar.require_hash=0
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php';
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.tar';
 $pname = 'phar://hio';
-$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a.php']   = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
index 19cf953197b777fde5d1ee0a7a6a813319416b67..946a0b470f0df200a4b1cb4289a520e953aff6ab 100644 (file)
@@ -10,7 +10,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php __HALT_COMPILER(); ?>';
+$file = (binary)'<?php __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index ef9fa283d5be58620e8829bb47d2781c55caea1a..d2b6a3703efa981c5b6f954089c626c4b2af6ce6 100644 (file)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index 901e4d2ebd5485b142dee307465abd8d6108e539..b92ab4bdff38751208473cd31b65cb591bab055c 100644 (file)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
index e907ca1236154dbb73376c75ed47e8cfb428e090..434e6471f58767f9265a9f9859659bfe2e52930e 100644 (file)
@@ -54,7 +54,7 @@ try {
 unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
 ?>
 --EXPECT--
-string(6661) "<?php
+string(6685) "<?php
 
 $web = 'index.php';
 
@@ -164,21 +164,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'index.php';
-const LEN = 6661;
+const LEN = 6685;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -349,7 +349,7 @@ __HALT_COMPILER(); ?>
 "
 ============================================================================
 ============================================================================
-string(6672) "<?php
+string(6696) "<?php
 
 $web = 'index.php';
 
@@ -459,21 +459,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6672;
+const LEN = 6696;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -644,7 +644,7 @@ __HALT_COMPILER(); ?>
 "
 ============================================================================
 ============================================================================
-string(6674) "<?php
+string(6698) "<?php
 
 $web = 'the/web.php';
 
@@ -754,21 +754,21 @@ const GZ = 0x1000;
 const BZ2 = 0x2000;
 const MASK = 0x3000;
 const START = 'my/custom/thingy.php';
-const LEN = 6674;
+const LEN = 6698;
 
 static function go($return = false)
 {
 $fp = fopen(__FILE__, 'rb');
 fseek($fp, self::LEN);
-$L = unpack('V', $a = fread($fp, 4));
-$m = '';
+$L = unpack('V', $a = (binary)fread($fp, 4));
+$m = (binary)'';
 
 do {
 $read = 8192;
 if ($L[1] - strlen($m) < 8192) {
 $read = $L[1] - strlen($m);
 }
-$last = fread($fp, $read);
+$last = (binary)fread($fp, $read);
 $m .= $last;
 } while (strlen($last) && strlen($m) < $L[1]);
 
@@ -939,6 +939,6 @@ __HALT_COMPILER(); ?>
 "
 ============================================================================
 ============================================================================
-int(7052)
+int(7076)
 Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
 ===DONE===
index ed306816e2dd6e7f661dfa036e8d299d36a149e1..7ce7bd08033610b2520d784f1d6f5a91a8bd5625 100644 (file)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 
 $files = array();
 $files['a'] = 'a';
@@ -18,13 +18,13 @@ $files['c'] = 'c';
 
 include 'files/phar_test.inc';
 
-$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 $fp = fopen($fname, 'rb');
 //// 1
 echo fread($fp, strlen($file)) . "\n";
 fclose($fp);
 $phar = new Phar($fname);
-$file = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
 
 //// 2
 $phar->setStub($file);
@@ -33,9 +33,9 @@ echo fread($fp, strlen($file)) . "\n";
 fclose($fp);
 
 $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phartmp.php';
-$file = '<?php echo "third stub\n"; __HALT_COMPILER(); ?>';
+$file = (binary)'<?php echo "third stub\n"; __HALT_COMPILER(); ?>';
 $fp = fopen($fname2, 'wb');
-fwrite($fp, $file);
+fwrite($fp, (binary)$file);
 fclose($fp);
 $fp = fopen($fname2, 'rb');
 
@@ -48,7 +48,7 @@ echo fread($fp, strlen($file)) . "\n";
 fclose($fp);
 
 $fp = fopen($fname2, 'ab');
-fwrite($fp, 'booya');
+fwrite($fp, (binary)'booya');
 fclose($fp);
 echo file_get_contents($fname2) . "\n";
 
@@ -69,7 +69,7 @@ $phar['testing'] = 'hi';
 // ensure stub is not overwritten
 $fp = fopen($fname, 'rb');
 echo fread($fp, strlen($file)) . "\n";
-if (fread($fp, strlen('booya')) == 'booya') {
+if (fread($fp, strlen('booya')) == (binary)'booya') {
        echo 'failed - copied booya';
 }
 fclose($fp);
index 99f313bc2ff92391fb9516eaa43bed0f4876cf07..2fe8bbef8407fbda7568a47ffc93832806d1123e 100755 (executable)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 $file = $stub;
 
 $files = array();
@@ -22,7 +22,7 @@ var_dump($stub);
 var_dump($phar->getStub());
 var_dump($phar->getStub() == $stub);
 
-$newstub = '<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>';
+$newstub = (binary)'<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>';
 try
 {
        $phar->setStub($newstub);
index 9e5d6d56352d2b2a794f25b71bbe53456601e9f9..975c9bf5ded5e3eb6257dc5b8aee17e1c1cc0ceb 100755 (executable)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 $file = $stub;
 
 $files = array();
@@ -24,7 +24,7 @@ var_dump($stub);
 var_dump($phar->getStub());
 var_dump($phar->getStub() == $stub);
 
-$stub = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
+$stub = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
 $sexp = $stub . "\r\n";
 
 $phar->setStub($stub);
index c5a0a1eba90140172cd5b1c7997f16dde63a66fa..fa58c12dedad94ce709dee43b812c15406b24bae 100755 (executable)
@@ -10,7 +10,7 @@ allow_url_fopen=1
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
+$stub = (binary)'<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
 $file = $stub;
 
 $files = array();
@@ -25,7 +25,7 @@ var_dump($stub);
 var_dump($phar->getStub());
 var_dump($phar->getStub() == $stub);
 
-$stub = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
+$stub = (binary)'<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
 $sexp = $stub . "\r\n";
 $stub = fopen('data://,'.$stub, 'r');
 $phar->setStub($stub);
index 910ef873d2d58ce94bd6da9a0e3b24ec0693947e..54c18324dc53ecd0f40e2de35262e9a70de6ad55 100644 (file)
@@ -90,7 +90,7 @@ Unknown phar archive ""
 Unknown phar archive "%sphar_unlinkarchive.phar"
 Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry)
 
-Warning: Phar::unlinkArchive() expects parameter 1 to be string, array given in %sphar_unlinkarchive.php on line %d
+Warning: Phar::unlinkArchive() expects parameter 1 to be binary string, array given in %sphar_unlinkarchive.php on line %d
 bool(false)
 string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
 phar archive "%sphar_unlinkarchive.phar" has open file handles or objects.  fclose() all file handles, and unset() all objects prior to calling unlinkArchive()
index 480c1222c477911949c0d20d8836908b8e37c475..46b1d170a8e0bd662411c3113570bd4d721d0b98 100644 (file)
@@ -47,7 +47,7 @@ echo $e->getMessage() . "\n";
 --EXPECTF--
 Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry)
 
-Warning: PharFileInfo::__construct() expects parameter 1 to be string, array given in %spharfileinfo_construct.php on line %d
+Warning: PharFileInfo::__construct() expects parameter 1 to be binary string, array given in %spharfileinfo_construct.php on line %d
 Cannot access phar file entry '/oops/I/do/not/exist' in archive '%spharfileinfo_construct.phar'
 Cannot call constructor twice
 '%spharfileinfo_construct.php' is not a valid phar archive URL (must have at least phar://filename.phar)
index dfa12f4ca4d046fca7efe37a16f834b3fedc50eb..f1d0f182829690e7fbcfa7c6fe42ab24f199e3cd 100644 (file)
@@ -9,7 +9,7 @@ phar.readonly=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 1a78d7b5b0f9d8fa72d710333b8f880a9f41129e..d49fd3e96b8d467c745202d336cff5d5a5148c73 100644 (file)
@@ -35,7 +35,9 @@ include $pname . '/foo/hi';
 <?php rmdir(dirname(__FILE__) . '/poo'); ?>
 <?php unlink(dirname(__FILE__) . '/foob'); ?>
 --EXPECTF--
-Warning: readfile() expects parameter 1 to be string, array given in %sreadfile_edgecases.php on line %d
+Notice: Array to string conversion in %sreadfile_edgecases.php on line %d
+
+Warning: readfile(Array): failed to open stream: No such file or directory in %sreadfile_edgecases.php on line %d
 blah
 <?php
 readfile("foo/" . basename(__FILE__));
index 234d49111c3a8b3635ef124ee4630c428fcfb644..e147a3ee0df14be4f264e204a2289eb214deafcf 100644 (file)
@@ -11,7 +11,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php __HALT_COMPILER(); ?>";
+$file = (binary)"<?php __HALT_COMPILER(); ?>";
 
 $files = array();
 $files['a.php'] = '<?php echo "This is a\n"; ?>';
@@ -20,7 +20,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 $fp = fopen($pname . '/b/c.php', 'wb');
-fwrite($fp, "extra");
+fwrite($fp, (binary)"extra");
 fclose($fp);
 echo "===CLOSE===\n";
 $p = new Phar($fname);
@@ -42,9 +42,9 @@ include $pname . '/b/c.php';
 --EXPECTF--
 ===CLOSE===
 object(PharFileInfo)#%d (2) {
-  ["pathName":"SplFileInfo":private]=>
+  [u"pathName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.php/b"
-  ["fileName":"SplFileInfo":private]=>
+  [u"fileName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.php/b/c.php"
 }
 string(5) "extra"
@@ -52,9 +52,9 @@ string(5) "extra"
 
 Warning: unlink(): phar error: "b/c.php" in phar "%srefcount1.phar.php", has open file pointers, cannot unlink in %srefcount1.php on line %d
 object(PharFileInfo)#%d (2) {
-  ["pathName":"SplFileInfo":private]=>
+  [u"pathName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.php/b"
-  ["fileName":"SplFileInfo":private]=>
+  [u"fileName":u"SplFileInfo":private]=>
   string(%s) "phar://%srefcount1.phar.php/b/c.php"
 }
 string(5) "extra"
index c73c98ec816f4e6fbc0cff8541fd969a6ca6a3da..499f45d942c67b8ce6619ed718b95670c695c312 100644 (file)
@@ -9,7 +9,7 @@ phar.require_hash=0
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $pname = 'phar://' . $fname;
-$file = "<?php
+$file = (binary)"<?php
 Phar::mapPhar('hio');
 __HALT_COMPILER(); ?>";
 
index 5eb18398670685046e81bcd25184cae0bc33b54f..af5ebc9b0cf8c9463f3669b2e849c7961bc1018e 100644 (file)
@@ -47,10 +47,10 @@ bool(false)
 string(2) "hi"
 string(3) "hi2"
 string(3) "hi3"
-string(6) "100444"
+unicode(6) "100444"
 string(32) "<?php ok __HALT_COMPILER(); ?>
 "
 string(4) "hime"
-string(8) "hi there"
-string(6) "a meta"
+unicode(8) "hi there"
+unicode(6) "a meta"
 ===DONE===
index c18bd199b38088ffde6eebd439b045f61ad716fc..413dd7bd1bdd576d9e2aaad537aa8934616dfda0 100644 (file)
@@ -3,7 +3,7 @@ include dirname(__FILE__) . '/tarmaker.php.inc';
 class corrupter extends tarmaker {
 function close()
 {
-       fwrite($this->tmp, 'oopsie');
+       fwrite($this->tmp, (binary)'oopsie');
        fclose($this->tmp);
 }
 }
\ No newline at end of file
index 902507881a0ce4267b6fc3010a802dfc3e80cc8a..446e4a20aa005103dcc7ec9cb1b9e5758a57fa84 100644 (file)
@@ -107,16 +107,16 @@ class tarmaker
 
         $checksum = pack('a8', sprintf('%6s ', decoct($checksum)));
 
-        fwrite($this->tmp, $block . $checksum . $blockend, 512);
+        fwrite($this->tmp, (binary)$block . $checksum . $blockend, 512);
         if (is_resource($fileOrStream)) {
             stream_copy_to_stream($fileOrStream, $this->tmp);
             if ($stat['size'] % 512) {
-                fwrite($this->tmp, str_repeat("\0", 512 - $stat['size'] % 512));
+                fwrite($this->tmp, (binary)str_repeat("\0", 512 - $stat['size'] % 512));
             }
         } else {
-            fwrite($this->tmp, $fileOrStream);
+            fwrite($this->tmp, (binary)$fileOrStream);
             if (strlen($fileOrStream) % 512) {
-                fwrite($this->tmp, str_repeat("\0", 512 - strlen($fileOrStream) % 512));
+                fwrite($this->tmp, (binary)str_repeat("\0", 512 - strlen($fileOrStream) % 512));
             }
         }
     }
@@ -163,7 +163,7 @@ class tarmaker
      */
     function close()
     {
-        fwrite($this->tmp, pack('a1024', ''));
+        fwrite($this->tmp, (binary)pack('a1024', ''));
         fclose($this->tmp);
     }
 }
\ No newline at end of file
index 6d84b6ed68ba413cefa09c253b6ab993c8e7abf8..f1fc6e3d0fd0094aa2c263e75b75ccd37dd3a370 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite array invalid tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller4.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 Status: 403 Access Denied
 --EXPECT--
 <html>
index f6dfaf27405c15773c32926818e869d7d9d93933..f58d6fd661f566baedc5da38a03c1d091a0090e1 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type extension is not a string tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller5.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.phar.php:2
 Stack trace:
index 760e8422c9dba5a41d0c61122c84edb08d9b34be..2086856cf31f663e81bdf1c631c2662db96a194d 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type unknown int tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller6.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.phar.php:2
 Stack trace:
index da5dc041a06988caea0a024c8d59044513c78006..ce7620a198d6b7ad731c18b80b31aad0689427b1 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type not string/int tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller7.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.phar.php:2
 Stack trace:
index 367ea725330654ba2c0302ec410905c3a06ab788..2147121dbe20610a4480489bc975f5c4c4d0406a 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHPS tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller8.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index ab4a28237f7540caa1aaea9368791d97315a7f8e..caa0c3119ddbc0ebe06500ae3900732771d3216b 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHP tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller8.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio1
 
index e7b5346889bfa2465801d555194489c0dfa72d64..82070e3b55aac65becfb52c7c8f99d807a11ff6c 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller PHP test tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio
index ff9353ab8e545f736dae7f82c939fe32221ac3cb..c1a299cc9ba94696cc1dfc5e627894825438aa2d 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller $_SERVER munging success tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -12,7 +12,7 @@ QUERY_STRING=test=hi
 --FILE_EXTERNAL--
 files/frontcontroller12.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(10) "/index.php"
 string(10) "/index.php"
index 75fede5444db5c750cc27b4de38f94c5b97685ac..06a4948f6b712175a3292f157ec61ae55cab2fb9 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller phps tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index 20bce784fe05de333b7ae76c8a20568f72ef35cc..247ebd4dc0f3b9dfd6829b257ab98dfc1afc77cc 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite array tar-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller3.phar.tar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index 641e5ce21d6bc15ac945226de2fd76d5b6defaaa..13b327dd6a84c33232cfd5667b077a1ed0f9cf4b 100644 (file)
@@ -27,7 +27,7 @@ foreach ($files as $n => $file) {
 $phar->stopBuffering();
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
index 54ec5855fb2649c1d97ffc4103c4ec8ce60c404b..39eb19e72d5ef0f159e423f1a421b4199a4c5e4b 100755 (executable)
@@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
@@ -45,12 +45,11 @@ include $alias . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d
 
-Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d
 This is b/c
 
 ===DONE===
index 0e5a181e65577a079f2a3042fda59edc1088cf97..a4c839bd25514ee191c09a78337130f972878caa 100755 (executable)
@@ -28,7 +28,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
@@ -39,10 +39,9 @@ include $alias . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
 This is b/c
index 31e9d4a7e91eb482dd64f47ccd7eb0097ac1dd43..06fc3946739f3d4af949c5ed63d08732031a93c4 100644 (file)
@@ -27,7 +27,7 @@ foreach ($files as $n => $file) {
 $phar->stopBuffering();
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
index d3a21b4caf74aafa0c5602ece8a547e0d6395f48..34b942ca3df9f0093ed20a95f385877624fe3874 100755 (executable)
@@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
@@ -46,10 +46,9 @@ include $alias . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
 This is b/c
index 231241c8adec33153a3565be452d28068e8271e8..736221d5ba30128a5fddc3f49bd3acd8d839111e 100755 (executable)
@@ -28,7 +28,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $alias . '/b/c.php';
 include $alias . '/b/new.php';
@@ -39,10 +39,9 @@ include $alias . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
 This is b/c
@@ -51,4 +50,4 @@ Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed t
 
 Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
 
-===DONE===
\ No newline at end of file
+===DONE===
index c990ff9b98d508e3f18f3d7668d8f6b77d18280a..e9812cfb140feb43e68d053c092e2a5eb52b7d3e 100755 (executable)
@@ -36,16 +36,16 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar.tar');
 bool(true)
 bool(true)
 bool(false)
-string(5) "Hello"
+unicode(5) "Hello"
 string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
-string(5) "World"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 ===COMMIT===
 bool(true)
-string(5) "Hello"
-string(5) "World"
+unicode(5) "Hello"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 ===DONE===
index 600bd2ee5c67adb70d39d9cfacc574b46a433c6c..49e50b76c2edfc53603a04b4ffbd89ea6a136b5b 100644 (file)
@@ -54,6 +54,6 @@ __HALT_COMPILER();
 rewind
 valid
 current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid value (must return a string)
 ===DONE===
index e891a5d065af5c3f2f226a3cf78f4771e84f6f65..962d42036fcd48d3aa50a4b44e0dbe71393d5c2f 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid key (must return a string)
 ===DONE===
index d64c032d714f202782f0337825fb3ac20d313164..60d5cdd3d90ccd54231799e1baeabd0e3efbb8bb 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
 ===DONE===
index 7ce221991b8e8fa37167569d89b528747896e451..07fed09e3b728929ead36891913486a93eeb9ab7 100644 (file)
@@ -47,12 +47,12 @@ __HALT_COMPILER();
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
-int(6659)
+int(6683)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===
index 03a6429d2aae2e40d9b78f87da0a6921dff6f2fc..58901ca7fc7365a47061108168530f1cde8ad328 100644 (file)
@@ -49,14 +49,14 @@ __HALT_COMPILER();
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
 int(4096)
-int(6659)
+int(6683)
 bool(true)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===
index f4768194d1c2e030043049bc0eb4529250e21690..543c89b502037320f641cb6594c773116d57afd4 100644 (file)
@@ -49,14 +49,14 @@ __HALT_COMPILER();
 ?>
 --EXPECT--
 bool(false)
-int(6651)
+int(6683)
 bool(true)
 string(60) "<?php // tar-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
 int(8192)
-int(6651)
+int(6683)
 bool(true)
 bool(true)
-int(6651)
+int(6683)
 ===DONE===
index e0d728f6f84192b650d5db214d568eec294a0450..9069adb6f8b7463bb1047880239470f7b7c5f9c0 100644 (file)
@@ -31,7 +31,7 @@ echo $phar->getStub();
 $fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phartmp.php';
 $file = '<?php echo "third stub\n"; __HALT_COMPILER(); ?>';
 $fp = fopen($fname3, 'wb');
-fwrite($fp, $file);
+fwrite($fp, (binary)$file);
 fclose($fp);
 $fp = fopen($fname3, 'rb');
 
@@ -42,7 +42,7 @@ fclose($fp);
 echo $phar->getStub();
 
 $fp = fopen($fname3, 'ab');
-fwrite($fp, 'booya');
+fwrite($fp, (binary)'booya');
 fclose($fp);
 echo file_get_contents($fname3) . "\n";
 
index 5d35b932fe6e915c39a5234a44274394b68054a5..7ab99b56897f871723e13fb34bc9d2b163b545b0 100755 (executable)
@@ -16,11 +16,11 @@ $phar->setAlias('hio');
 $phar['a'] = 'a';
 $phar->stopBuffering();
 
-var_dump($stub);
+var_dump((binary)$stub);
 var_dump($phar->getStub());
 var_dump($phar->getStub() == $stub);
 
-$newstub = '<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>';
+$newstub = (binary)'<?php echo "second stub\n"; _x_HALT_COMPILER(); ?>';
 
 try {
        $phar->setStub($newstub);
index c6808afb63b8b498b98e3c5a321ba4a3c107bac7..1c2c574c69ca9c92c8d86909ed12d7f546ea0221 100644 (file)
@@ -15,7 +15,7 @@ $alias = 'phar://' . $fname;
 
 $tar = new tarmaker($fname, 'none');
 $tar->init();
-$tar->addFile('.phar/stub.php', "<?php __HALT_COMPILER(); ?>");
+$tar->addFile('.phar/stub.php', (binary)"<?php __HALT_COMPILER(); ?>");
 
 $files = array();
 
@@ -31,7 +31,7 @@ foreach ($files as $n => $file) {
 $tar->close();
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, "extra");
+fwrite($fp, (binary)"extra");
 fclose($fp);
 echo "===CLOSE===\n";
 $phar = new Phar($fname);
@@ -54,9 +54,9 @@ include $alias . '/b/c.php';
 --EXPECTF--
 ===CLOSE===
 object(PharFileInfo)#%d (2) {
-  ["pathName":"SplFileInfo":private]=>
+  [u"pathName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.tar/b"
-  ["fileName":"SplFileInfo":private]=>
+  [u"fileName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.tar/b/c.php"
 }
 string(5) "extra"
@@ -64,9 +64,9 @@ string(5) "extra"
 
 Warning: unlink(): phar error: "b/c.php" in phar "%srefcount1.phar.tar", has open file pointers, cannot unlink in %srefcount1.php on line %d
 object(PharFileInfo)#%d (2) {
-  ["pathName":"SplFileInfo":private]=>
+  [u"pathName":u"SplFileInfo":private]=>
   string(%d) "phar://%srefcount1.phar.tar/b"
-  ["fileName":"SplFileInfo":private]=>
+  [u"fileName":u"SplFileInfo":private]=>
   string(%s) "phar://%srefcount1.phar.tar/b/c.php"
 }
 string(5) "extra"
index b390805dc3dc146f111629c989bcb3ac745a6a19..e55f0c4533b71f9f0a5b0331374081392967eb0d 100644 (file)
@@ -14,7 +14,7 @@ $alias = 'phar://' . $fname;
 
 $tar = new tarmaker($fname, 'none');
 $tar->init();
-$tar->addFile('.phar/stub.php', "<?php // tar-based phar archive stub file\n__HALT_COMPILER();");
+$tar->addFile('.phar/stub.php', (binary)"<?php // tar-based phar archive stub file\n__HALT_COMPILER();");
 $tar->addFile('tar_003.phpt', $g = fopen(__FILE__, 'r'));
 $tar->addFile('internal/file/here', "hi there!\n");
 $tar->mkDir('internal/dir');
index 2dd7ba169f74ab7b5d87b9cf7ede67397ee343ca..5fa36394640bcc4aa7f7fa4590944a7136edaeb2 100644 (file)
@@ -33,6 +33,6 @@ include $fname;
 @unlink(dirname(__FILE__) . '/tar_004.phar.tar');
 ?>
 --EXPECTF--
-string(9) "it worked"
-string(%d) "phar://%star_004.phar.tar/tar_004.php"
+unicode(9) "it worked"
+unicode(%d) "phar://%star_004.phar.tar/tar_004.php"
 ===DONE===
\ No newline at end of file
index ad1454143105c885507987fa2346d1a305d0657e..c08829797b6149a554b25a08d203498afa2a50d6 100644 (file)
@@ -47,8 +47,8 @@ var_dump($phar2->isCompressed() == Phar::BZ2);
 @unlink(dirname(__FILE__) . '/tar_bz2.phar.tar');
 ?>
 --EXPECTF--
-string(9) "it worked"
-string(%d) "phar://%star_bz2.phar/tar_004.php"
+unicode(9) "it worked"
+unicode(%d) "phar://%star_bz2.phar/tar_004.php"
 bool(true)
 bool(true)
 ===DONE===
\ No newline at end of file
index 8287ee7f06479986e63d29c6e61ce0fa972aa773..1394f8acbc573a877c40b271cb129705e51f5969 100644 (file)
@@ -44,8 +44,8 @@ var_dump($b->isCompressed() == Phar::GZ);
 @unlink(dirname(__FILE__) . '/tar_gzip.phar.tar');
 ?>
 --EXPECTF--
-string(9) "it worked"
-string(%d) "phar://%star_gzip.phar/tar_004.php"
+unicode(9) "it worked"
+unicode(%d) "phar://%star_gzip.phar/tar_004.php"
 bool(true)
 bool(true)
 ===DONE===
\ No newline at end of file
index a082c35b440439befc0a2b23e58ed7c9f2d54d00..e9fc104ee859a13d9e1586c095b0008c1e13f393 100644 (file)
@@ -11,6 +11,6 @@ PATH_INFO=/web.php
 --FILE_EXTERNAL--
 files/nophar.phar
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 web
index 84bbfc36bebbe953608f782e48f703a624c745c2..1351e3ea76dd15446720748ca0305a7faf1513df 100644 (file)
@@ -53,10 +53,10 @@ string(3) "hi3"
 bool(false)
 bool(true)
 bool(true)
-string(6) "100444"
+unicode(6) "100444"
 string(32) "<?php ok __HALT_COMPILER(); ?>
 "
 string(4) "hime"
-string(8) "hi there"
-string(6) "a meta"
+unicode(8) "hi there"
+unicode(6) "a meta"
 ===DONE===
index f337604041336132b0fb6fd6d702beed5fbad707..56d16c2064ab5ca115ca4381525d6ee8c2ce9655 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite array invalid zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller4.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 Status: 403 Access Denied
 --EXPECT--
 <html>
index 9bd4aa41c0720ced031a7304880e01f10dd152bf..581e84e2a1efc197d665b40edf5d962e9a86efef 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type extension is not a string zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller5.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.phar.php:2
 Stack trace:
index 7d84e89e81253914be47179c026ad9204a236433..504d03717735f470ce51091c7d69c6dd9999b62d 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type unknown int zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller6.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.phar.php:2
 Stack trace:
index 03694fe81b7587d95aad6c0bb3962380a397acfe..4b9e910a2544b86d6e22f09d4562445b9d17ab32 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type not string/int zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller7.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.phar.php:2
 Stack trace:
index 321381c6e1ec8e30680068b11446cf19ebe9855a..f6cd29a3c53f7e49c197e46a6a273b4f32be6c20 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHPS zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller8.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index 9ee88161b2bc0b4a1313c8fba324578308233ace..d3f457bea6d1c6034c86985eba5346b1415fb4ea 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller mime type override, Phar::PHP zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller8.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio1
 
index 3d64b29972bc5e0482c38d3eb63bbd701679049a..e143e79f3f6fc009348939ab7e1d0f137b510956 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller PHP test zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,6 +12,6 @@ PATH_INFO=/a.php
 --FILE_EXTERNAL--
 files/frontcontroller.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 hio
index fe22ad766e4f7233551a27d5635e0e87ee5a75c6..d0a16c5d99f0b9465394cc686f8617f3faac90d6 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller $_SERVER munging success zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -13,7 +13,7 @@ QUERY_STRING=test=hi
 --FILE_EXTERNAL--
 files/frontcontroller12.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(10) "/index.php"
 string(10) "/index.php"
index 2adcee47b51f2e0e944ab7baaafa7525b6f30a6b..88a8a2490d8bc056d264a8081c784731e7203c2e 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller phps zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
@@ -12,7 +12,7 @@ PATH_INFO=/a.phps
 --FILE_EXTERNAL--
 files/frontcontroller.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index 0f3d36bd35767c879cd50e5845db7c9f16fc0815..4f12c9cd430e7b778d8c55f92b64cb77d4686443 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 Phar front controller rewrite array zip-based
 --INI--
-default_charset=
+default_charset=UTF-8
 --SKIPIF--
 <?php if (!extension_loaded("phar")) die("skip"); ?>
 --ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
 --FILE_EXTERNAL--
 files/frontcontroller3.phar.zip
 --EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 --EXPECT--
 <code><span style="color: #000000">
 <span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
index cf0945d153dc4eb87433fd8d1f4c07ab56651bfd..4bc8c10095064c5ec6dfc880904255f423558d55 100644 (file)
@@ -64,8 +64,8 @@ NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
 string(1) "a"
@@ -77,9 +77,9 @@ NULL
 array(2) {
   [0]=>
   int(25)
-  ["foo"]=>
-  string(3) "bar"
+  [u"foo"]=>
+  unicode(3) "bar"
 }
 bool(true)
-string(2) "hi"
+unicode(2) "hi"
 ===DONE===
index 94f85b4e3f753e9ee3b93ee8668cd9bd7246463c..8d5e4fdc9df664924bf559e5f0bcc3360199a0e1 100644 (file)
@@ -26,7 +26,7 @@ foreach ($files as $n => $file) {
 $phar->stopBuffering();
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $alias . '/b/c.php';
 ?>
index 347a1ce719554af633a940bf3738ead6591bd94f..145f31aa897213de211f425703583d64ad4938b7 100755 (executable)
@@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $alias . '/b/c.php';
 ?>
@@ -42,11 +42,10 @@ include $alias . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_b.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_b.php on line %d
 
-Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_b.php on line %d
 This is b/c
-===DONE===
\ No newline at end of file
+===DONE===
index b66a77b2128922bc1421b1efa7eb75ebb58556cc..fb75a05364983e7b1e272133c08b5b6aa37893ec 100755 (executable)
@@ -28,7 +28,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 $fp = fopen($alias . '/b/c.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 include $alias . '/b/c.php';
 ?>
@@ -36,11 +36,10 @@ include $alias . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_existing_c.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_existing_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_existing_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
 This is b/c
-===DONE===
\ No newline at end of file
+===DONE===
index c3782d4fd3d11d591ddbf1d96aa72e2d183618b7..3a24ead65942f3b1de1ca35f6e534690c8908943 100644 (file)
@@ -26,7 +26,7 @@ foreach ($files as $n => $file) {
 $phar->stopBuffering();
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
index 44ad7487fa0fbb6998f11b39e77ae81e90a83a4b..bf29990d660a8767e4e09c2efe559d9ce547c1d7 100755 (executable)
@@ -34,7 +34,7 @@ function err_handler($errno, $errstr, $errfile, $errline) {
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
@@ -45,10 +45,9 @@ include $alias . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_b.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
 This is b/c
index b664397a99aef66d50ac918b2a392d8dda7f8414..2a2a555e2de547636c293b7a12c0ae5b0a2ad736 100755 (executable)
@@ -28,7 +28,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 $fp = fopen($alias . '/b/new.php', 'wb');
-fwrite($fp, 'extra');
+fwrite($fp, (binary)'extra');
 fclose($fp);
 
 include $alias . '/b/c.php';
@@ -39,10 +39,9 @@ include $alias . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
 --EXPECTF--
-
 Warning: fopen(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by INI setting in %sopen_for_write_newfile_c.php on line %d
 
-Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
+Warning: fwrite() expects parameter 1 to be resource, boolean given in %sopen_for_write_newfile_c.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
 This is b/c
@@ -51,4 +50,4 @@ Warning: include(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed t
 
 Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
 
-===DONE===
\ No newline at end of file
+===DONE===
index 81cf4001c3024326c5b8bcc77f0df8e95466a4da..389454fbbece7caf77dbda11376493a002d3687d 100755 (executable)
@@ -49,16 +49,16 @@ unlink(dirname(__FILE__) . '/myfakestub.php');
 bool(true)
 bool(true)
 bool(false)
-string(5) "Hello"
+unicode(5) "Hello"
 string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
-string(5) "World"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 ===COMMIT===
 bool(true)
-string(5) "Hello"
-string(5) "World"
+unicode(5) "Hello"
+unicode(5) "World"
 string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
 "
 string(93) "<?php var_dump("First resource"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
index 450ada100ddb63f19e415a9d60c9805eed6e26cb..ff5de2ba94a492901df5e0620a0bd1d384b6e55f 100644 (file)
@@ -54,6 +54,6 @@ __HALT_COMPILER();
 rewind
 valid
 current
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid value (must return a string)
 ===DONE===
index 2dfb04dbf0d630986d6e527fdca3665fb2413763..8897d5c355dadd925b8648f4e5ff5388577a9773 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned an invalid key (must return a string)
 ===DONE===
index 16ba6d61b93a93dab16dea4c26e00e6f98a604ba..1775552481097ce1314f7c0cd921a9dcfaf972bc 100644 (file)
@@ -55,6 +55,6 @@ rewind
 valid
 current
 key
-string(24) "UnexpectedValueException"
+unicode(24) "UnexpectedValueException"
 Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
 ===DONE===
index d511a0b36ac78d9eeb000d202756dd2fbdd1039e..cad6d9fc7f896b301305c7de880c1921cd868787 100644 (file)
@@ -46,12 +46,12 @@ __HALT_COMPILER();
 ?>
 --EXPECT--
 bool(false)
-int(6659)
+int(6683)
 bool(true)
 string(60) "<?php // zip-based phar archive stub file
 __HALT_COMPILER();"
 bool(true)
-int(6659)
+int(6683)
 bool(true)
-int(6659)
+int(6683)
 ===DONE===