From 1d50248937071cdbd2a8b5bcb05f19c41640db50 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 26 Jul 2009 03:07:23 +0000 Subject: [PATCH] make cache_list tests pass in php 6 --- ext/phar/phar_object.c | 17 +---------------- .../tests/cache_list/copyonwrite17.phar.phpt | 2 +- .../tests/cache_list/copyonwrite19.phar.phpt | 2 +- .../cache_list/files/frontcontroller12.phar | Bin 581 -> 588 bytes .../files/frontcontroller12.phar.inc | 14 +++++++------- .../cache_list/files/frontcontroller14.phar | Bin 448 -> 450 bytes .../files/frontcontroller14.phar.inc | 4 ++-- .../cache_list/files/frontcontroller3.phar | Bin 446 -> 437 bytes .../files/frontcontroller3.phar.inc | 2 +- .../cache_list/files/frontcontroller4.phar | Bin 442 -> 433 bytes .../files/frontcontroller4.phar.inc | 2 +- .../cache_list/files/frontcontroller8.phar | Bin 8968 -> 8970 bytes .../files/frontcontroller8.phar.inc | 2 +- ext/phar/tests/cache_list/files/write24.phar | Bin 326 -> 327 bytes .../tests/cache_list/files/write24.phar.inc | 2 +- .../tests/cache_list/frontcontroller21.phpt | 2 +- .../tests/cache_list/frontcontroller22.phpt | 4 ++-- 17 files changed, 19 insertions(+), 34 deletions(-) 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 9e455876101ba0d48dc523b1ff74e5577503b2ad..1cf362928208fa6660410ad0cf31e4481470bcc3 100644 GIT binary patch delta 120 zcmX@ga)xEXT>)!G28Q*=vb{ibxcKRyiEkYklP2pjDg(&?Ms*-r4rb3{R0Xp4GitCW zDFt{q2E|VfWK=VTvV&X$LtTSI;zNTxm0~rmx%iXcJQ2w1bxSY)5ML<7{)>MWqXZKJ K1B1JhuM+^54kNk% delta 121 zcmX@Za+GDlT>%qD1_sH0_3j|rzW?->iEkYy>oF?xC#F{sps7=C Ued&uc*A#setStub('G$PyVLqQ9m*| VH8*WeNI%B$VF?pZvAdJ669D`+7fk>F delta 65 zcmX@ae1Lg_9ixCB0|P^C_fvNeEp{|tZL%Mu!sL8L#mN&HMP;587(U+6<@9Lw5$PxU T60e`%Tiqni1XSqmsetStub('sx5GU$o6{LeCW?@ml t237#FTMVjVav7tJ%rmE*cQtmgX5{K!5|ev&Cf@z{vfoTV1@2D1P5?oXMVan#GcuJFZ0!`367_&Oip4mz~JuW>jVJwxI1qE diff --git a/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc index 2759d9ee45..6f9126ff44 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc @@ -7,7 +7,7 @@ $a['a.phps'] = '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 4c9a92a197b8b47a026701005b94625185ea6958..83594618104f93833aba1a8b029afd040ed6bb84 100644 GIT binary patch delta 204 zcmdnRyph??#=anYMCpxMLg4GtKmXsFdDX1h`bJb3)wlU*MP0q+yP|D9QC{{?x zOi{?oFHtBe&5OxXvgRsFEQ(Jl%`MPSiFfr2(@{`~4|WX-a}5F-_raRQ{#drxWPL_i q2qS<|4#Fs6)Rmq$msP84UQ7kwl#ZE~b*$=S3yhc;7#Q50e4PLcNk1e2 delta 191 zcmdnUyo=e<#=anan#GcuJFZ0!`%5_5`EHLZCk+Np^^6c?qIlosVFs3cnRa@F!qEVW_eow!jNNSpx? z&#hJG&Ry@$%)r2~_Wkw?+ZcfiAYcXJM7^wnbdUr{!DM$vITkP@lTlaN{&VIc=Z!DI Xd9yDh*I)E-eP$fX1XSqmsetStub(' 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 ec05ceafb0cd228716b92068a5318d654e77f7b3..c9c0e409ec4b9b8ca6dfd07edd777df9bf3a5d04 100644 GIT binary patch delta 232 zcmeBh>vEg$-s8uyY%dlD1_s{tZ0&7~Kn4)71976EUO`4du_KTPQUao%7?r(%DPaXE z(aS1G2k8YVm~74{%K~OZFe*bB^^EeWAQ2&;lG=HSFOl`;<)>DZFv0X5hG}^PV+b;- zLkzKD(veP53UUn$bqx-Q4-N8Eiq%n2i4S%S3UdvLPTJhal&v81&TV6#;})j!lEaCd Tf7<7D8Ho5uf(&u{U!-Xm0j&x3`5fq}O@TYDQLkO2hjK%8i(SCCOqY!76Dlz`~#%bUz$N?1Wk z^s)-lL3%+7CYv+LvVa*8jLHy3J)^uTNJI#zq;{U-OJu!y`Kc8pOfbENVOn0n7=ldd z5JPO3bR?C6TmwU0gG1s&gFKaDbre+MgI$BdT!W%FH#21`$VA?q_Mx4{v`zG9Y^ru| QeD$T7X0jlo-JN`$0OoKtxBvhE 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'] = 'bcI@<6@0((_T6G3h729u&4-Q6B$*f(7~GwF FodD2>5jX$< delta 47 zcmX@kbc|_2!^FlqmXoJHc}!+z)R0k6KN*xik^9sEPrl7O+Z1xt{5rUp7#JAboqU}D D$~zF1 diff --git a/ext/phar/tests/cache_list/files/write24.phar.inc b/ext/phar/tests/cache_list/files/write24.phar.inc index ac96731960..216f7c46d0 100644 --- a/ext/phar/tests/cache_list/files/write24.phar.inc +++ b/ext/phar/tests/cache_list/files/write24.phar.inc @@ -8,7 +8,7 @@ $phar->setStub('