From: Greg Beaver Date: Sun, 26 Jul 2009 03:07:23 +0000 (+0000) Subject: make cache_list tests pass in php 6 X-Git-Tag: php-5.4.0alpha1~191^2~2965 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7e232cd2b50e4f04e41c3846ae26bbd7bb2e5bd;p=php make cache_list tests pass in php 6 --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 96376a3f4a..b4c6e9f045 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -941,19 +941,7 @@ PHP_METHOD(Phar, webPhar) ++ext; #if PHP_MAJOR_VERSION >= 6 - if (FAILURE == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { - /* try unicode extension */ - zstr zext; - zspprintf(IS_UNICODE, &zext, 0, "%s", ext); - if (SUCCESS == zend_u_hash_find(Z_ARRVAL_P(mimeoverride), IS_UNICODE, zext, strlen(ext)+1, (void **) &val)) { - ezfree(zext); - goto unicode_found; - } - ezfree(zext); - goto notfound; - } -unicode_found: - { /* this prevents parse error */ + if (phar_find_key(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { #else if (SUCCESS == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { #endif @@ -990,9 +978,6 @@ unicode_found: } } -#if PHP_MAJOR_VERSION >= 6 -notfound: -#endif if (!mime_type) { code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC); } diff --git a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt index 6e13088512..158c049b14 100644 --- a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt @@ -10,5 +10,5 @@ phar.readonly=0 files/write17.phar --EXPECTF-- NULL -string(2) "hi" +%string|unicode%(2) "hi" ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt index 4870550c4d..6e03554d96 100644 --- a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt @@ -10,5 +10,5 @@ phar.readonly=0 files/write19.phar --EXPECTF-- string(2) "hi" -string(3) "hi2" +%string|unicode%(3) "hi2" ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar b/ext/phar/tests/cache_list/files/frontcontroller12.phar index 9e45587610..1cf3629282 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller12.phar and b/ext/phar/tests/cache_list/files/frontcontroller12.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc index ba17df37e1..f1e4645e2f 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc @@ -3,13 +3,13 @@ $a = new Phar(dirname(__FILE__) . '/frontcontroller12.phar'); $a['index.php'] = 'setStub('setStub('setStub(' "a.phps"); + static $b = array(b"/hi" => "a.phps"); if (isset($b[$a])) return $b[$a]; return $a; } diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar b/ext/phar/tests/cache_list/files/frontcontroller4.phar index 4c9a92a197..8359461810 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller4.phar and b/ext/phar/tests/cache_list/files/frontcontroller4.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc index 5c6a43f954..daf807e419 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc @@ -7,7 +7,7 @@ $a['a.phps'] = 'setStub(' false); + static $b = array(b"/hi" => false); if (isset($b[$a])) return $b[$a]; return $a; } diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar b/ext/phar/tests/cache_list/files/frontcontroller8.phar index ec05ceafb0..c9c0e409ec 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller8.phar and b/ext/phar/tests/cache_list/files/frontcontroller8.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc index 1dfb654a03..8629f0890d 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc @@ -2,7 +2,7 @@ @unlink(dirname(__FILE__) . '/frontcontroller8.phar'); $a = new Phar(dirname(__FILE__) . '/frontcontroller8.phar'); $a['a.phps'] = 'hio1'; -$a['a1.phps'] = 'setStub('