From 85e641ebb4ce9b96fed93f269128e251f24fbfed Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Tue, 12 Feb 2008 16:39:59 +0000 Subject: [PATCH] Make tests/tar in line with tests/zip. --- ext/phar/tests/tar/033.phpt | 41 +++-- ext/phar/tests/tar/033a.phpt | 45 +++-- ext/phar/tests/tar/delete.phpt | 26 ++- ext/phar/tests/tar/delete_in_phar.phpt | 45 +++-- ext/phar/tests/tar/delete_in_phar_b.phpt | 39 ++-- .../tests/tar/delete_in_phar_confirm.phpt | 40 ++--- ext/phar/tests/tar/frontcontroller.phar.inc | 13 -- ext/phar/tests/tar/frontcontroller.phar.tar | Bin 6144 -> 0 bytes ext/phar/tests/tar/frontcontroller1.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller10.phar.inc | 20 --- .../tests/tar/frontcontroller10.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller10.phar.tar | Bin 3072 -> 0 bytes ext/phar/tests/tar/frontcontroller11.phar.inc | 20 --- .../tests/tar/frontcontroller11.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller11.phar.tar | Bin 3072 -> 0 bytes ext/phar/tests/tar/frontcontroller12.phar.inc | 20 --- .../tests/tar/frontcontroller12.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller12.phar.tar | Bin 3072 -> 0 bytes .../tests/tar/frontcontroller13.phar.phpt | 2 +- .../tests/tar/frontcontroller14.phar.phpt | 2 +- .../tests/tar/frontcontroller15.phar.phpt | 2 +- .../tests/tar/frontcontroller16.phar.phpt | 2 +- .../tests/tar/frontcontroller17.phar.phpt | 2 +- .../tests/tar/frontcontroller18.phar.phpt | 2 +- .../tests/tar/frontcontroller19.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller2.phar.inc | 12 -- ext/phar/tests/tar/frontcontroller2.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller2.phar.tar | Bin 5120 -> 0 bytes .../tests/tar/frontcontroller20.phar.phpt | 2 +- .../tests/tar/frontcontroller21.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller3.phar.inc | 18 -- ext/phar/tests/tar/frontcontroller3.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller3.phar.tar | Bin 5120 -> 0 bytes ext/phar/tests/tar/frontcontroller4.phar.inc | 18 -- ext/phar/tests/tar/frontcontroller4.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller4.phar.tar | Bin 5120 -> 0 bytes ext/phar/tests/tar/frontcontroller5.phar.inc | 12 -- ext/phar/tests/tar/frontcontroller5.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller5.phar.tar | Bin 5120 -> 0 bytes ext/phar/tests/tar/frontcontroller6.phar.inc | 12 -- ext/phar/tests/tar/frontcontroller6.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller6.phar.tar | Bin 5120 -> 0 bytes ext/phar/tests/tar/frontcontroller7.phar.inc | 12 -- ext/phar/tests/tar/frontcontroller7.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller7.phar.tar | Bin 5120 -> 0 bytes ext/phar/tests/tar/frontcontroller8.phar.inc | 13 -- ext/phar/tests/tar/frontcontroller8.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller8.phar.tar | Bin 6144 -> 0 bytes ext/phar/tests/tar/frontcontroller9.phar.inc | 14 -- ext/phar/tests/tar/frontcontroller9.phar.phpt | 2 +- ext/phar/tests/tar/frontcontroller9.phar.tar | Bin 6144 -> 0 bytes ext/phar/tests/tar/make_invalid_tar.php.inc | 9 - .../tests/tar/open_for_write_existing.phpt | 27 +-- .../tests/tar/open_for_write_existing_b.phpt | 40 +++-- .../tests/tar/open_for_write_existing_c.phpt | 36 ++-- .../tests/tar/open_for_write_newfile.phpt | 29 +-- .../tests/tar/open_for_write_newfile_b.phpt | 40 +++-- .../tests/tar/open_for_write_newfile_c.phpt | 37 ++-- ext/phar/tests/tar/phar_setalias.phpt | 26 +-- ext/phar/tests/tar/phar_setalias2.phpt | 31 ++-- ext/phar/tests/tar/phar_stub_error.phpt | 44 +++-- ext/phar/tests/tar/refcount1.phpt | 44 ++--- ext/phar/tests/tar/rename.phpt | 31 ++-- ext/phar/tests/tar/tar_001.phpt | 23 +-- ext/phar/tests/tar/tar_002.phpt | 26 +-- ext/phar/tests/tar/tar_003.phpt | 46 ++--- ext/phar/tests/tar/tar_004.phpt | 27 +-- ext/phar/tests/tar/tar_bz2.phpt | 36 ++-- ext/phar/tests/tar/tar_gzip.phpt | 2 +- ext/phar/tests/tar/tar_makebz2.phpt | 27 +-- ext/phar/tests/tar/tar_makegz.phpt | 27 +-- ext/phar/tests/tar/tar_nostub.phpt | 25 +-- ext/phar/tests/tar/tarmaker.php.inc | 169 ------------------ 73 files changed, 481 insertions(+), 783 deletions(-) delete mode 100644 ext/phar/tests/tar/frontcontroller.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller10.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller10.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller11.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller11.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller12.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller12.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller2.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller2.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller3.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller3.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller4.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller4.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller5.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller5.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller6.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller6.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller7.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller7.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller8.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller8.phar.tar delete mode 100644 ext/phar/tests/tar/frontcontroller9.phar.inc delete mode 100644 ext/phar/tests/tar/frontcontroller9.phar.tar delete mode 100644 ext/phar/tests/tar/make_invalid_tar.php.inc delete mode 100644 ext/phar/tests/tar/tarmaker.php.inc diff --git a/ext/phar/tests/tar/033.phpt b/ext/phar/tests/tar/033.phpt index 662e462fa9..2f4e4b2a4f 100644 --- a/ext/phar/tests/tar/033.phpt +++ b/ext/phar/tests/tar/033.phpt @@ -7,38 +7,37 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('a.php', ''); -$a->addFile('.phar/alias.txt', 'hio'); -$a->mkDir('test'); -$a->close(); +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://hio'; + +$phar = new Phar($fname); +$phar['a.php'] = ''; +$phar->setAlias('hio'); +$phar['test/'] = ''; +$phar->stopBuffering(); try { - $a = new Phar($fname); - var_dump($a['a.php']->isExecutable()); - $a['a.php']->chmod(0777); - var_dump($a['a.php']->isExecutable()); - $a['a.php']->chmod(0666); - var_dump($a['a.php']->isExecutable()); + var_dump($phar['a.php']->isExecutable()); + $phar['a.php']->chmod(0777); + var_dump($phar['a.php']->isExecutable()); + $phar['a.php']->chmod(0666); + var_dump($phar['a.php']->isExecutable()); echo "test dir\n"; - var_dump($a['test']->isReadable()); - $a['test']->chmod(0000); - var_dump($a['test']->isReadable()); - $a['test']->chmod(0666); - var_dump($a['test']->isReadable()); + var_dump($phar['test']->isReadable()); + $phar['test']->chmod(0000); + var_dump($phar['test']->isReadable()); + $phar['test']->chmod(0666); + var_dump($phar['test']->isReadable()); } catch (Exception $e) { echo $e->getMessage() . "\n"; } + ?> ===DONE=== --CLEAN-- --EXPECTF-- bool(false) diff --git a/ext/phar/tests/tar/033a.phpt b/ext/phar/tests/tar/033a.phpt index 469dbfb94c..92c089faa9 100644 --- a/ext/phar/tests/tar/033a.phpt +++ b/ext/phar/tests/tar/033a.phpt @@ -3,34 +3,33 @@ Phar::chmod tar-based --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('a.php', ''); -$a->addFile('.phar/alias.txt', 'hio'); -$a->mkDir('test'); -$a->close(); +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://hio'; + +$phar = new Phar($fname); +$phar['a.php'] = ''; +$phar->setAlias('hio'); +$phar['test/'] = ''; +$phar->stopBuffering(); +ini_set('phar.readonly', 1); try { - $a = new Phar($fname); - var_dump($a['a.php']->isExecutable()); - $a['a.php']->chmod(0777); - var_dump($a['a.php']->isExecutable()); - $a['a.php']->chmod(0666); - var_dump($a['a.php']->isExecutable()); + var_dump($phar['a.php']->isExecutable()); + $phar['a.php']->chmod(0777); + var_dump($phar['a.php']->isExecutable()); + $phar['a.php']->chmod(0666); + var_dump($phar['a.php']->isExecutable()); echo "test dir\n"; - var_dump($a['test']->isExecutable()); - $a['test']->chmod(0777); - var_dump($a['test']->isExecutable()); - $a['test']->chmod(0666); - var_dump($a['test']->isExecutable()); + var_dump($phar['test']->isReadable()); + $phar['test']->chmod(0000); + var_dump($phar['test']->isReadable()); + $phar['test']->chmod(0666); + var_dump($phar['test']->isReadable()); } catch (Exception $e) { echo $e->getMessage() . "\n"; } @@ -38,9 +37,9 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- bool(false) -Cannot modify permissions for file "a.php" in phar "%s033a.1.phar.php", write operations are prohibited +Cannot modify permissions for file "a.php" in phar "%s033a.phar.tar", write operations are prohibited ===DONE=== diff --git a/ext/phar/tests/tar/delete.phpt b/ext/phar/tests/tar/delete.phpt index 9e94116af4..32b2b1e28b 100644 --- a/ext/phar/tests/tar/delete.phpt +++ b/ext/phar/tests/tar/delete.phpt @@ -7,28 +7,26 @@ phar.readonly=0 phar.require_hash=0 --FILE-- "; -$a = new tarmaker($fname, 'none'); -$a->init(); -$a->addFile('a', 'a'); -$a->addFile('.phar/stub.php', $file); -$a->close(); - $phar = new Phar($fname); +$phar['a'] = 'a'; +$phar->setStub($stub); +$phar->stopBuffering(); -echo file_get_contents($pname . '/a') . "\n"; +echo file_get_contents($alias . '/a') . "\n"; $phar->delete('a'); -echo file_get_contents($pname . '/a') . "\n"; +echo file_get_contents($alias . '/a') . "\n"; + ?> --CLEAN-- - + --EXPECTF-- a -Warning: file_get_contents(phar://%sdelete.phar.php/a): failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.php" in %sdelete.php on line %d \ No newline at end of file +Warning: file_get_contents(phar://%sdelete.phar.tar/a): failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.tar" in %sdelete.php on line %d \ No newline at end of file diff --git a/ext/phar/tests/tar/delete_in_phar.phpt b/ext/phar/tests/tar/delete_in_phar.phpt index 6cf539599c..91ef4a2046 100644 --- a/ext/phar/tests/tar/delete_in_phar.phpt +++ b/ext/phar/tests/tar/delete_in_phar.phpt @@ -7,33 +7,33 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('a.php', ''); -$a->addFile('b.php', ''); -$a->addFile('b/c.php', ''); -$a->addFile('.phar/stub.php', ''); -$a->close(); - -include $pname . '/a.php'; -include $pname . '/b.php'; -include $pname . '/b/c.php'; -unlink($pname . '/b/c.php'); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar['a.php'] = ''; +$phar['b.php'] = ''; +$phar['b/c.php'] = ''; +$phar->setStub(''); +$phar->stopBuffering(); + +include $alias . '/a.php'; +include $alias . '/b.php'; +include $alias . '/b/c.php'; +unlink($alias . '/b/c.php'); + ?> ===AFTER=== ===DONE=== --CLEAN-- - + --EXPECTF-- This is a This is b @@ -42,9 +42,8 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar.phar.php/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.php" in %sdelete_in_phar.php on line %d +Warning: include(%sdelete_in_phar.phar.tar/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.tar" in %sdelete_in_phar.php on line %d -Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d +Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d ===DONE=== - \ No newline at end of file diff --git a/ext/phar/tests/tar/delete_in_phar_b.phpt b/ext/phar/tests/tar/delete_in_phar_b.phpt index 937e69b015..2af1c66deb 100644 --- a/ext/phar/tests/tar/delete_in_phar_b.phpt +++ b/ext/phar/tests/tar/delete_in_phar_b.phpt @@ -3,37 +3,38 @@ Phar: delete a file within a tar-based .phar --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('a.php', ''); -$a->addFile('b.php', ''); -$a->addFile('b/c.php', ''); -$a->addFile('.phar/stub.php', ''); -$a->close(); +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar['a.php'] = ''; +$phar['b.php'] = ''; +$phar['b/c.php'] = ''; +$phar->setStub(''); +$phar->stopBuffering(); +ini_set('phar.readonly', 1); + +include $alias . '/a.php'; +include $alias . '/b.php'; +include $alias . '/b/c.php'; +unlink($alias . '/b/c.php'); -include $pname . '/a.php'; -include $pname . '/b.php'; -include $pname . '/b/c.php'; -unlink($pname . '/b/c.php'); ?> ===AFTER=== ===DONE=== --CLEAN-- - + --EXPECTF-- This is a This is b diff --git a/ext/phar/tests/tar/delete_in_phar_confirm.phpt b/ext/phar/tests/tar/delete_in_phar_confirm.phpt index 971e40d90d..707bcbd0ed 100644 --- a/ext/phar/tests/tar/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/tar/delete_in_phar_confirm.phpt @@ -7,36 +7,36 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('a.php', ''); -$a->addFile('b.php', ''); -$a->addFile('b/c.php', ''); -$a->addFile('.phar/stub.php', ''); -$a->close(); -include $pname . '/a.php'; -include $pname . '/b.php'; -include $pname . '/b/c.php'; +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar['a.php'] = ''; +$phar['b.php'] = ''; +$phar['b/c.php'] = ''; +$phar->setStub(''); +$phar->stopBuffering(); + +include $alias . '/a.php'; +include $alias . '/b.php'; +include $alias . '/b/c.php'; $md5 = md5_file($fname); -unlink($pname . '/b/c.php'); +unlink($alias . '/b/c.php'); clearstatcache(); $md52 = md5_file($fname); if ($md5 == $md52) echo 'file was not modified'; ?> ===AFTER=== ===DONE=== --CLEAN-- - + --EXPECTF-- This is a This is b @@ -45,8 +45,8 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar_confirm.phar.php/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d +Warning: include(%sdelete_in_phar_confirm.phar.tar/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.tar" in %sdelete_in_phar_confirm.php on line %d -Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d +Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d ===DONE=== diff --git a/ext/phar/tests/tar/frontcontroller.phar.inc b/ext/phar/tests/tar/frontcontroller.phar.inc deleted file mode 100644 index 6f426e8864..0000000000 --- a/ext/phar/tests/tar/frontcontroller.phar.inc +++ /dev/null @@ -1,13 +0,0 @@ -setStub(' diff --git a/ext/phar/tests/tar/frontcontroller.phar.tar b/ext/phar/tests/tar/frontcontroller.phar.tar deleted file mode 100644 index 522d097845e6ecce56a7b2f3352a6ae824657d17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHJT}#6-6y0;d{}9F=I*^&BZ3de-L<$O1N0mJZAzQ1hu%z_E4`lz{G`@At`Owr# zlZVo#&AGQH_uLaYN}{BvcEECAjH^-P{MW^X792YejgjNZ85i4j^?N1HMV8aF2cZ)1 z_Jc+-Z-0_HLuCvI`P1|y%Zrt|Mj!?Klm0Eosp?-egPne%goKXk|8yq$zp)TSFqyoD ztMbMiPK|IKanR>H$v_YXfbkrp1$$uqsqsQn5)_-n91!njc?<^R&hwX^FIEw9c|N}< z7q{1otGVY3ATT>SGL-C_2CanwI(kl?YC+l$a!~&ee&heh*^gM`n~v*W`+tqK^betE zY5SSl#1HEq;i~^*i1hhi?Y2mC>HpxdVCy{Q42X7M4nMXH1lA#1!9dJ{@J-#(U;g7S p^bdFR?;@)ag1YYiVH$!s1DkgsOQ8|Ybr8*fWsetStub(' diff --git a/ext/phar/tests/tar/frontcontroller10.phar.phpt b/ext/phar/tests/tar/frontcontroller10.phar.phpt index fbbe312d1e..0ca67b3d3e 100644 --- a/ext/phar/tests/tar/frontcontroller10.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller10.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller10.phar.php REQUEST_URI=/frontcontroller10.phar.php/hi PATH_INFO=/hi --FILE_EXTERNAL-- -frontcontroller4.phar.tar +files/frontcontroller4.phar.tar --EXPECTHEADERS-- Content-type: text/html Status: 403 Access Denied diff --git a/ext/phar/tests/tar/frontcontroller10.phar.tar b/ext/phar/tests/tar/frontcontroller10.phar.tar deleted file mode 100644 index d43ed916a13489480678609c069207eb1efe69e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHHU2DQH6!lrye+Xp{6=aJVTX17iBx1pjEUmt5BhJPw-gaU3)vY6i8?8e1QdpGFD1T7cfWdy)SDtD&zrDA5++?;G8zY(l>6=4( z494mGlv=i!a`P`HHZZuzswe^FDC-cHRa=5h7kK_t&0ir%-;vkrO*Ajg1Y$iO)qe~B z(7#R^t^8kc0iu7}}yY88Pq_ Z4n(MXcTqiI`sLBG17!!w4*c5=yaOHTw2}Y- diff --git a/ext/phar/tests/tar/frontcontroller11.phar.inc b/ext/phar/tests/tar/frontcontroller11.phar.inc deleted file mode 100644 index 2fa15f097e..0000000000 --- a/ext/phar/tests/tar/frontcontroller11.phar.inc +++ /dev/null @@ -1,20 +0,0 @@ -setStub(' diff --git a/ext/phar/tests/tar/frontcontroller11.phar.phpt b/ext/phar/tests/tar/frontcontroller11.phar.phpt index 472abc3026..697718cc69 100644 --- a/ext/phar/tests/tar/frontcontroller11.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller11.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller11.phar.php REQUEST_URI=/frontcontroller11.phar.php/a.php PATH_INFO=/a.php --FILE_EXTERNAL-- -frontcontroller5.phar.tar +files/frontcontroller5.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECTF-- diff --git a/ext/phar/tests/tar/frontcontroller11.phar.tar b/ext/phar/tests/tar/frontcontroller11.phar.tar deleted file mode 100644 index c8f98a1e78f04cc44c0d48d8c9ad53e6aacf08a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHHU2B6d6zy|i{~^d86w0Q~Ds*E-N{WK*vS|CVjbNv&eW*&*Zu|F(b{|f*Diom) z$wNr4CpS0edd?;a!nccLo%FgJaxrvWuisF{i%HWpS&O>xuov_J{j0iB z*T11DO8ZwFf#mvU`bX?17>%}h^x}qe7gEuu)PMh+r2!DCvijM6tA~ZEB9WM7>{Gsm zt70LtK={0lfe^<@3W7}lqBsLIj~*l8m%YIGasa+uh@B$DG98ah?q-PD2xf`E`1Y)S SM8o+}&H!hCGr$=r82A7ir?K4t diff --git a/ext/phar/tests/tar/frontcontroller12.phar.inc b/ext/phar/tests/tar/frontcontroller12.phar.inc deleted file mode 100644 index 693ef0aa01..0000000000 --- a/ext/phar/tests/tar/frontcontroller12.phar.inc +++ /dev/null @@ -1,20 +0,0 @@ -setStub(' diff --git a/ext/phar/tests/tar/frontcontroller12.phar.phpt b/ext/phar/tests/tar/frontcontroller12.phar.phpt index e49a633bfa..9109586932 100644 --- a/ext/phar/tests/tar/frontcontroller12.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller12.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller12.phar.php REQUEST_URI=/frontcontroller12.phar.php/a.php PATH_INFO=/a.php --FILE_EXTERNAL-- -frontcontroller6.phar.tar +files/frontcontroller6.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECTF-- diff --git a/ext/phar/tests/tar/frontcontroller12.phar.tar b/ext/phar/tests/tar/frontcontroller12.phar.tar deleted file mode 100644 index 06e7e59b03ed4677e37bd252d5d13ad712b7d5aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmd1IOG&NJE66BdpdBy(0W&i*bQ{3pAi~7V#K6$N+{D1h+{o0>7$jt7YHW(Go+kX# z;*!K71_J|{7(Vz7wXp}rJy%&`QG7~iZh?kMe6VX!m}^k9Qh-MQknQ896su{CO+MH; z$TJ`$-p|q3m4FgAPaju&%7R=2LtTSI;zNTxahVk0;TRN8$VFg9L^ums9U-@Y)uKCa z@W(3gE(B)%#3KFTlF}sF6#}6Aj5q%SvpstLH#ae)PnI0b|G@ko089i{R=K5l>A|T* zWvN9PiA6<;l^TdbKu19dIcFib@C*bLLe3|ez)}NZYI$lBh@k-#NKMYjS5V5&FDO<> z$xKnm%P&zVD$R?@Q$i_WT>Zjy6kr7rP*;4shoetOytBV=0I(zp0ve=XZ^z3;d>S8B RIT`|^Aut*OqalD90sv#~vL*lk diff --git a/ext/phar/tests/tar/frontcontroller13.phar.phpt b/ext/phar/tests/tar/frontcontroller13.phar.phpt index c90a2cc9c1..974145b830 100644 --- a/ext/phar/tests/tar/frontcontroller13.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller13.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller13.phar.php REQUEST_URI=/frontcontroller13.phar.php/a.php PATH_INFO=/a.php --FILE_EXTERNAL-- -frontcontroller7.phar.tar +files/frontcontroller7.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECTF-- diff --git a/ext/phar/tests/tar/frontcontroller14.phar.phpt b/ext/phar/tests/tar/frontcontroller14.phar.phpt index 90ee6fd757..c40f9b6c34 100644 --- a/ext/phar/tests/tar/frontcontroller14.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller14.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller14.phar.php REQUEST_URI=/frontcontroller14.phar.php/a.jpg PATH_INFO=/a.jpg --FILE_EXTERNAL-- -frontcontroller8.phar.tar +files/frontcontroller8.phar.tar --EXPECTHEADERS-- Content-type: foo/bar Content-length: 4 diff --git a/ext/phar/tests/tar/frontcontroller15.phar.phpt b/ext/phar/tests/tar/frontcontroller15.phar.phpt index 66911f373f..154117fda4 100644 --- a/ext/phar/tests/tar/frontcontroller15.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller15.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller15.phar.php REQUEST_URI=/frontcontroller15.phar.php/a.php PATH_INFO=/a.php --FILE_EXTERNAL-- -frontcontroller8.phar.tar +files/frontcontroller8.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller16.phar.phpt b/ext/phar/tests/tar/frontcontroller16.phar.phpt index 381336a29c..042a695eb3 100644 --- a/ext/phar/tests/tar/frontcontroller16.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller16.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller16.phar.php REQUEST_URI=/frontcontroller16.phar.php/a.phps PATH_INFO=/a.phps --FILE_EXTERNAL-- -frontcontroller8.phar.tar +files/frontcontroller8.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller17.phar.phpt b/ext/phar/tests/tar/frontcontroller17.phar.phpt index 639f8b7d7f..17d04baf30 100644 --- a/ext/phar/tests/tar/frontcontroller17.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller17.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller17.phar.php REQUEST_URI=/frontcontroller17.phar.php/fronk.gronk PATH_INFO=/fronk.gronk --FILE_EXTERNAL-- -frontcontroller8.phar.tar +files/frontcontroller8.phar.tar --EXPECTHEADERS-- Content-type: application/octet-stream Content-length: 4 diff --git a/ext/phar/tests/tar/frontcontroller18.phar.phpt b/ext/phar/tests/tar/frontcontroller18.phar.phpt index eb9875ca6f..4ecb69a138 100644 --- a/ext/phar/tests/tar/frontcontroller18.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller18.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller18.phar.php REQUEST_URI=/frontcontroller18.phar.php/fronk.gronk PATH_INFO=/fronk.gronk --FILE_EXTERNAL-- -frontcontroller9.phar.tar +files/frontcontroller9.phar.tar --EXPECTF-- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller18.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller19.phar.phpt b/ext/phar/tests/tar/frontcontroller19.phar.phpt index 9f52f8824f..2cba4a9a56 100644 --- a/ext/phar/tests/tar/frontcontroller19.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller19.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller19.phar.php REQUEST_URI=/frontcontroller19.phar.php/ PATH_INFO=/ --FILE_EXTERNAL-- -frontcontroller10.phar.tar +files/frontcontroller10.phar.tar --EXPECTF-- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller19.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller2.phar.inc b/ext/phar/tests/tar/frontcontroller2.phar.inc deleted file mode 100644 index 8ae1171a38..0000000000 --- a/ext/phar/tests/tar/frontcontroller2.phar.inc +++ /dev/null @@ -1,12 +0,0 @@ -setStub(' diff --git a/ext/phar/tests/tar/frontcontroller2.phar.phpt b/ext/phar/tests/tar/frontcontroller2.phar.phpt index 92b9665ba2..a6b1c780fd 100644 --- a/ext/phar/tests/tar/frontcontroller2.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller2.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller2.phar.php REQUEST_URI=/frontcontroller2.phar.php/a.php PATH_INFO=/a.php --FILE_EXTERNAL-- -frontcontroller.phar.tar +files/frontcontroller.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller2.phar.tar b/ext/phar/tests/tar/frontcontroller2.phar.tar deleted file mode 100644 index 857b1168901195870d265265ff233dc48a1e30f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHKU2B6d6z#LH{}4hS6iOFA8ljGrF@z1et=Q40K}f5c4rYQM?ZeoApV~LKwlBu5 zaPuG<&AEq@oO_UuWh@732dM|8v|Xi{-(PHE64xP?YdI6Uo|;hm$M@~^ojjL$!LtD& zoq(MmNSuiCBMpo@Q=qax&o1+#T&rsYjm3}o-=uEa|E^<#|2x~|!$4QFs{dJUt) zyJ%hC=y(_NBHBh79wE%@bAb&{i#D-9SO}S;FbPpA3Y3-UONu>h%QF_1A5tGO|8X@! zL$>sTl^;~A7`wZfKeOAXhsFKe4|Kyrv+E1(Fd=x;s{(xdF5eVaJn4Tze#w8!RZMFS z5BcAV%uwWiD$um|TrIcL{z>% diff --git a/ext/phar/tests/tar/frontcontroller20.phar.phpt b/ext/phar/tests/tar/frontcontroller20.phar.phpt index 3a83efb72f..42ec810aee 100644 --- a/ext/phar/tests/tar/frontcontroller20.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller20.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller20.phar.php REQUEST_URI=/frontcontroller20.phar.php/ PATH_INFO=/ --FILE_EXTERNAL-- -frontcontroller11.phar.tar +files/frontcontroller11.phar.tar --EXPECTF-- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller20.phar.php:2 Stack trace: diff --git a/ext/phar/tests/tar/frontcontroller21.phar.phpt b/ext/phar/tests/tar/frontcontroller21.phar.phpt index 2313cbba75..eb21897226 100644 --- a/ext/phar/tests/tar/frontcontroller21.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller21.phar.phpt @@ -8,7 +8,7 @@ REQUEST_URI=/frontcontroller21.phar.php/index.php?test=hi PATH_INFO=/index.php QUERY_STRING=test=hi --FILE_EXTERNAL-- -frontcontroller12.phar.tar +files/frontcontroller12.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECTF-- diff --git a/ext/phar/tests/tar/frontcontroller3.phar.inc b/ext/phar/tests/tar/frontcontroller3.phar.inc deleted file mode 100644 index 9729d0065b..0000000000 --- a/ext/phar/tests/tar/frontcontroller3.phar.inc +++ /dev/null @@ -1,18 +0,0 @@ -setStub(' "a.phps"); - if (isset($b[$a])) return $b[$a]; - return $a; -} -Phar::webPhar("whatever", "/index.php", null, array(), "s"); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller3.phar.phpt b/ext/phar/tests/tar/frontcontroller3.phar.phpt index 9980ea2d29..dee16ee2b2 100644 --- a/ext/phar/tests/tar/frontcontroller3.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller3.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller3.phar.php REQUEST_URI=/frontcontroller3.phar.php/a.phps PATH_INFO=/a.phps --FILE_EXTERNAL-- -frontcontroller.phar.tar +files/frontcontroller.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller3.phar.tar b/ext/phar/tests/tar/frontcontroller3.phar.tar deleted file mode 100644 index f733884d122423acf03d633cc2536db7ac40b923..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHJO>2Wd5Y1WeKMacpg^+0c2qaBHDMAZr8`6?XTV#!TsC(Q6!x*q z>(7H2P#h;Ic%cVTOo3$4V}w}n6()|Cy(Y5c*f+B#NY0%-o!QeIuj5>vkMEs}+v~~I z*q+KtA4Wq_;6}0|4vbqb$unnsd-<=bKkR?~+kJrx%oFE-z5ls%)xQZ^PI10)_w&DF rRrkN8>h=Af?{6uh7yBQ+);}8uva;D8AaR|du0UOZx&n0t{setStub(' false); - if (isset($b[$a])) return $b[$a]; - return $a; -} -Phar::webPhar("whatever", "index.php", null, array(), "s"); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller4.phar.phpt b/ext/phar/tests/tar/frontcontroller4.phar.phpt index da16c389c6..db4846c69b 100644 --- a/ext/phar/tests/tar/frontcontroller4.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller4.phar.phpt @@ -6,7 +6,7 @@ Phar front controller index.php relocate (no /) tar-based SCRIPT_NAME=/frontcontroller4.phar.php REQUEST_URI=/frontcontroller4.phar.php --FILE_EXTERNAL-- -frontcontroller.phar.tar +files/frontcontroller.phar.tar --EXPECTHEADERS-- Status: 301 Moved Permanently Location: /frontcontroller4.phar.php/index.php diff --git a/ext/phar/tests/tar/frontcontroller4.phar.tar b/ext/phar/tests/tar/frontcontroller4.phar.tar deleted file mode 100644 index 5d11af499c181d8bada5b7a9d0579368cb034865..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHJQES355cavy|8SH(v>=*lZ9%6pMqvZDi5tFbqolU39WE_Ns~h5fUs~OeGUij9 zVDF*iE|u2wYrn=7Ev<|BK;7q2@BtPf6*O#M5_v-$3 zd^2(;n%;xqK$iAP;+)pF@s_*_zVJc(BlOGsH`{{4+L}Le{8#h;C{=c{PH^62nb`0S uisYFw-nZk`42zipSJ@|UvG}!xN=ctpvpj%fhq(4nt?A?jEfoo diff --git a/ext/phar/tests/tar/frontcontroller5.phar.inc b/ext/phar/tests/tar/frontcontroller5.phar.inc deleted file mode 100644 index d6204c7d97..0000000000 --- a/ext/phar/tests/tar/frontcontroller5.phar.inc +++ /dev/null @@ -1,12 +0,0 @@ -setStub(' "oops")); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller5.phar.phpt b/ext/phar/tests/tar/frontcontroller5.phar.phpt index a8c122b834..534e66a1e3 100644 --- a/ext/phar/tests/tar/frontcontroller5.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller5.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller5.phar.php REQUEST_URI=/frontcontroller5.phar.php/ PATH_INFO=/ --FILE_EXTERNAL-- -frontcontroller.phar.tar +files/frontcontroller.phar.tar --EXPECTHEADERS-- Status: 301 Moved Permanently Location: /frontcontroller5.phar.php/index.php diff --git a/ext/phar/tests/tar/frontcontroller5.phar.tar b/ext/phar/tests/tar/frontcontroller5.phar.tar deleted file mode 100644 index e6e9015bf8e23f9532eb73997712f8dcbc2d39da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHJ-%G|6`BQP47v(};BWNW4oBk1UyZZMWdq0vqa{Zr8s{XIdsv;PTHu0kV zF!W7Ai+CLi-2!^bqWG<@jmlu;}cC>;0mXn~Kr!&A4158}8f=*W diff --git a/ext/phar/tests/tar/frontcontroller6.phar.inc b/ext/phar/tests/tar/frontcontroller6.phar.inc deleted file mode 100644 index 66212d82e8..0000000000 --- a/ext/phar/tests/tar/frontcontroller6.phar.inc +++ /dev/null @@ -1,12 +0,0 @@ -setStub(' 100)); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller6.phar.phpt b/ext/phar/tests/tar/frontcontroller6.phar.phpt index 313630929b..5375beef8c 100644 --- a/ext/phar/tests/tar/frontcontroller6.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller6.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller6.phar.php REQUEST_URI=/frontcontroller6.phar.php/notfound.php PATH_INFO=/notfound.php --FILE_EXTERNAL-- -frontcontroller.phar.tar +files/frontcontroller.phar.tar --EXPECTHEADERS-- Status: 404 Not Found --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller6.phar.tar b/ext/phar/tests/tar/frontcontroller6.phar.tar deleted file mode 100644 index d30b7ab9eb204c030bc020ea5bf21043abe10047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHKU2B6d6z#LH{}4hS6r_tEi%_?gF@z1et+>&rfyC;j!$pbOu8jTnMYo3{V|_{| zm^?^sNKUTDd+tFpDUxC&cA#cpjJvnA>)#Ix8OX7b>6kXQnx!*rIoq{AgXfyAt2C#8w*yuC_&f^p@)F5_WI!??8TdyAz5rDsetStub(' null)); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller7.phar.phpt b/ext/phar/tests/tar/frontcontroller7.phar.phpt index b15ca07ff4..3b73f2075c 100644 --- a/ext/phar/tests/tar/frontcontroller7.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller7.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller7.phar.php REQUEST_URI=/frontcontroller7.phar.php/ PATH_INFO=/ --FILE_EXTERNAL-- -frontcontroller2.phar.tar +files/frontcontroller2.phar.tar --EXPECTHEADERS-- Status: 301 Moved Permanently Location: /frontcontroller7.phar.php/a.php diff --git a/ext/phar/tests/tar/frontcontroller7.phar.tar b/ext/phar/tests/tar/frontcontroller7.phar.tar deleted file mode 100644 index c7ccc940c149fafcc84595c7c736094bc574e4b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHJQEP)R5bm?E{}4hS6r@YlMyOlM7{UhKR@~^*AjImX!$pbOZjAl+se7u(`qFd- zlLzsR_}%&CzPr#-7G(pm3)Kr_+>X-te;+0qBillTZCH3xyC&EgxAzON%e>^z@UI846>dl0W6=c~Sb}8bKrRzw~dIsI7n78XrfJJ=g!myz2kTvMPeySxmrAt>xaAL?ZWj`%>nb-nIf#(R diff --git a/ext/phar/tests/tar/frontcontroller8.phar.inc b/ext/phar/tests/tar/frontcontroller8.phar.inc deleted file mode 100644 index f51a762806..0000000000 --- a/ext/phar/tests/tar/frontcontroller8.phar.inc +++ /dev/null @@ -1,13 +0,0 @@ -setStub(' "foo/bar", "phps" => Phar::PHP, "php" => Phar::PHPS)); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller8.phar.phpt b/ext/phar/tests/tar/frontcontroller8.phar.phpt index 0f6f50c700..19844cb199 100644 --- a/ext/phar/tests/tar/frontcontroller8.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller8.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller8.phar.php REQUEST_URI=/frontcontroller8.phar.php/ PATH_INFO=/ --FILE_EXTERNAL-- -frontcontroller3.phar.tar +files/frontcontroller3.phar.tar --EXPECTHEADERS-- Status: 404 Not Found --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller8.phar.tar b/ext/phar/tests/tar/frontcontroller8.phar.tar deleted file mode 100644 index 98495717cec043718c39f6c04632a3c90bccd93d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHLU2DQH6y0-S{~-h)S`dx3AE28uM!|vGiVmL!CE9Acxum46ZjAl+B^5+0%%_N~ z$wRmaH#avYIro&}RvM?-mDGkra~$V*lX8C7S*U|t3z@EIId19B?PGr_<08v3yFy4x z@XHSxC$w|bt?5jN_I8p|ILtJyXNyp z(CclZxiECNjd31rA_kiPCM1kL#oOQmQmofafEmMII($o45Zn#`TvFPerAT$T8Ag=`WwGC!LSbU^Q{)1&f7I{Jm;N?I!zJK;tr;LA&z>-n& r-dc%X+DT9IzpDQ({~aJLp~Jv6=RYTW_Ye+cD+Ck*3IT;cJrMW>setStub(' "foo/bar", "phps" => Phar::PHP, "php" => Phar::PHPS)); -echo "oops did not run\n"; -var_dump($_ENV, $_SERVER); -__HALT_COMPILER();'); -?> diff --git a/ext/phar/tests/tar/frontcontroller9.phar.phpt b/ext/phar/tests/tar/frontcontroller9.phar.phpt index 93540a68b4..080db58f8f 100644 --- a/ext/phar/tests/tar/frontcontroller9.phar.phpt +++ b/ext/phar/tests/tar/frontcontroller9.phar.phpt @@ -7,7 +7,7 @@ SCRIPT_NAME=/frontcontroller9.phar.php REQUEST_URI=/frontcontroller9.phar.php/hi PATH_INFO=/hi --FILE_EXTERNAL-- -frontcontroller3.phar.tar +files/frontcontroller3.phar.tar --EXPECTHEADERS-- Content-type: text/html --EXPECT-- diff --git a/ext/phar/tests/tar/frontcontroller9.phar.tar b/ext/phar/tests/tar/frontcontroller9.phar.tar deleted file mode 100644 index 481864c1cf465897f23968ad6d7298f2af522da5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHJQES355Z<$}{}74~Er_PIwxF9bM!|vGiVmL!CE9AcX;RWwH^%<^k~&0Nm@mc& zCJ!NZy?l55(l1w3kHa{*5;`CsmSq)_$`{2~yOC71YL`fr+gQU5k`iK(W5dg1!N>9J$4xa=cn zx0e~7j{>?1sEQ~>pQ@&Hejlxa36D{gb%@e{MJP3(MA#2L_-DfmoGlhLu-T@(#d8JR zc7ZY@q%lExFmE%tbCb*My9|Nv<$+t@h^GvuApr^@aRU6v2biRQX808=oyrPP&(D^z zTJ@Z#aSc?xkuw}SL$=HF`gemD@BaDGeHb`HRqKFW_qtLzZfWi_fa>h9_FYG}4(cDm zQvYvRO{xE*pF|mu_5aiSXO&Y+&lxa)#I^nH+a1=wVHNv-%QBl=0FevX|HBx}GCWNq zf&se@RPF0qB;gYKoEVrQ;a--ebgte{=s3)epr{AuplUC!lNG9Vd{ K3`hq4oq-=B1C(C? diff --git a/ext/phar/tests/tar/make_invalid_tar.php.inc b/ext/phar/tests/tar/make_invalid_tar.php.inc deleted file mode 100644 index c18bd199b3..0000000000 --- a/ext/phar/tests/tar/make_invalid_tar.php.inc +++ /dev/null @@ -1,9 +0,0 @@ -tmp, 'oopsie'); - fclose($this->tmp); -} -} \ No newline at end of file diff --git a/ext/phar/tests/tar/open_for_write_existing.phpt b/ext/phar/tests/tar/open_for_write_existing.phpt index 8e57d10f44..641e5ce21d 100644 --- a/ext/phar/tests/tar/open_for_write_existing.phpt +++ b/ext/phar/tests/tar/open_for_write_existing.phpt @@ -7,31 +7,36 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$fp = fopen($pname . '/b/c.php', 'wb'); +$phar->stopBuffering(); + +$fp = fopen($alias . '/b/c.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; + +include $alias . '/b/c.php'; + ?> ===DONE=== --CLEAN-- - + --EXPECT-- extra ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index e462133431..54ec5855fb 100755 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -3,46 +3,54 @@ Phar: fopen a .phar for writing (existing file) tar-based --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); + +$phar->stopBuffering(); +ini_set('phar.readonly', 1); function err_handler($errno, $errstr, $errfile, $errline) { - echo "Catchable fatal error: $errstr in $errfile on line $errline\n"; + echo "Catchable fatal error: $errstr in $errfile on line $errline\n"; } set_error_handler("err_handler", E_RECOVERABLE_ERROR); -$fp = fopen($pname . '/b/c.php', 'wb'); +$fp = fopen($alias . '/b/c.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; + +include $alias . '/b/c.php'; + ?> + ===DONE=== --CLEAN-- - + --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar.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: 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 %spen_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: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d This is b/c -===DONE=== \ No newline at end of file + +===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index b73e9e4200..0e5a181e65 100755 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -3,40 +3,48 @@ Phar: fopen a .phar for writing (existing file) tar-based --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$fp = fopen($pname . '/b/c.php', 'wb'); +$phar->stopBuffering(); +ini_set('phar.readonly', 1); + +$fp = fopen($alias . '/b/c.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; + +include $alias . '/b/c.php'; + ?> + ===DONE=== --CLEAN-- - + --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar.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: 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: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d This is b/c -===DONE=== \ No newline at end of file + +===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_newfile.phpt b/ext/phar/tests/tar/open_for_write_newfile.phpt index 904f245b05..31e9d4a7e9 100644 --- a/ext/phar/tests/tar/open_for_write_newfile.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile.phpt @@ -7,32 +7,37 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$fp = fopen($pname . '/b/new.php', 'wb'); +$phar->stopBuffering(); + +$fp = fopen($alias . '/b/new.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; -include $pname . '/b/new.php'; + +include $alias . '/b/c.php'; +include $alias . '/b/new.php'; + ?> ===DONE=== --CLEAN-- - + --EXPECT-- This is b/c extra diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index 129d54ae85..d3a21b4caf 100755 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -3,53 +3,59 @@ Phar: fopen a .phar for writing (new file) tar-based --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); + +$phar->stopBuffering(); +ini_set('phar.readonly', 1); function err_handler($errno, $errstr, $errfile, $errline) { - echo "Catchable fatal error: $errstr in $errfile on line $errline\n"; + echo "Catchable fatal error: $errstr in $errfile on line $errline\n"; } set_error_handler("err_handler", E_RECOVERABLE_ERROR); -$fp = fopen($pname . '/b/new.php', 'wb'); +$fp = fopen($alias . '/b/new.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; -include $pname . '/b/new.php'; + +include $alias . '/b/c.php'; +include $alias . '/b/new.php'; + ?> ===DONE=== --CLEAN-- - + --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar.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: 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: 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.tar.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.tar.php" in %sopen_for_write_newfile_b.php on line %d +Warning: include(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d -Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.tar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d +Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index f7b1ef7eee..231241c8ad 100755 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -3,47 +3,52 @@ Phar: fopen a .phar for writing (new file) tar-based --SKIPIF-- --INI-- -phar.readonly=1 +phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; + +$phar = new Phar($fname); +$phar->setStub(""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$fp = fopen($pname . '/b/new.php', 'wb'); +$phar->stopBuffering(); +ini_set('phar.readonly', 1); + +$fp = fopen($alias . '/b/new.php', 'wb'); fwrite($fp, 'extra'); fclose($fp); -include $pname . '/b/c.php'; -include $pname . '/b/new.php'; +include $alias . '/b/c.php'; +include $alias . '/b/new.php'; + ?> ===DONE=== --CLEAN-- - + --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar.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: 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: 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.tar.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.tar.php" in %sopen_for_write_newfile_c.php on line %d +Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d -Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar.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.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 diff --git a/ext/phar/tests/tar/phar_setalias.phpt b/ext/phar/tests/tar/phar_setalias.phpt index db6a22391d..1102df7c19 100644 --- a/ext/phar/tests/tar/phar_setalias.phpt +++ b/ext/phar/tests/tar/phar_setalias.phpt @@ -7,33 +7,35 @@ phar.require_hash=0 phar.readonly=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ''); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; + +$phar = new Phar($fname); +$phar->setStub(''); +$phar->setAlias('hio'); $files = array(); + $files['a'] = 'a'; $files['b'] = 'b'; $files['c'] = 'c'; -$files['.phar/alias.txt'] = 'hio'; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$phar = new Phar($fname); +$phar->stopBuffering(); + echo $phar->getAlias() . "\n"; $phar->setAlias('test'); echo $phar->getAlias() . "\n"; + ?> ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/tar/phar_setalias2.phpt b/ext/phar/tests/tar/phar_setalias2.phpt index 63be3b5d07..d48c041b76 100644 --- a/ext/phar/tests/tar/phar_setalias2.phpt +++ b/ext/phar/tests/tar/phar_setalias2.phpt @@ -7,44 +7,47 @@ phar.require_hash=0 phar.readonly=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ''); + +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; + +$phar = new Phar($fname); +$phar->setStub(''); +$phar->setAlias('hio'); $files = array(); + $files['a'] = 'a'; $files['b'] = 'b'; $files['c'] = 'c'; -$files['.phar/alias.txt'] = 'hio'; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $phar[$n] = $file; } -$a->close(); -$phar = new Phar($fname); +$phar->stopBuffering(); + echo $phar->getAlias() . "\n"; $phar->setAlias('test'); echo $phar->getAlias() . "\n"; + $phar = new Phar(dirname(__FILE__) . '/notphar.phar'); + try { $phar->setAlias('test'); } catch (Exception $e) { echo $e->getMessage() . "\n"; } + ?> ===DONE=== --CLEAN-- --EXPECTF-- hio test -alias "test" is already used for archive "%sphar_setalias2.phar.php" and cannot be used for other archives +alias "test" is already used for archive "%sphar_setalias2.phar.tar" and cannot be used for other archives ===DONE=== diff --git a/ext/phar/tests/tar/phar_stub_error.phpt b/ext/phar/tests/tar/phar_stub_error.phpt index 0c4de9657a..5d35b932fe 100755 --- a/ext/phar/tests/tar/phar_stub_error.phpt +++ b/ext/phar/tests/tar/phar_stub_error.phpt @@ -7,35 +7,27 @@ phar.require_hash=0 phar.readonly=0 --FILE-- init(); -$a->addFile('.phar/stub.php', $stub = ''); -$files = array(); -$files['a'] = 'a'; -$files['.phar/alias.txt'] = 'hio'; -foreach ($files as $n => $file) { -$a->addFile($n, $file); -} -$a->close(); +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; $phar = new Phar($fname); +$phar->setStub($stub = '' ."\r\n"); +$phar->setAlias('hio'); +$phar['a'] = 'a'; +$phar->stopBuffering(); + var_dump($stub); var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); $newstub = ''; -try -{ + +try { $phar->setStub($newstub); -} -catch(exception $e) -{ +} catch(exception $e) { echo 'Exception: ' . $e->getMessage() . "\n"; } + var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); $phar->stopBuffering(); @@ -46,16 +38,20 @@ var_dump($phar->getStub() == $stub); ===DONE=== --CLEAN-- --EXPECTF-- -string(48) "" -string(48) "" +string(50) " +" +string(50) " +" bool(true) -Exception: illegal stub for tar-based phar "%sphar_stub_error.phar.php" -string(48) "" +Exception: illegal stub for tar-based phar "%sphar_stub_error.phar.tar" +string(50) " +" bool(true) -string(48) "" +string(50) " +" bool(true) ===DONE=== diff --git a/ext/phar/tests/tar/refcount1.phpt b/ext/phar/tests/tar/refcount1.phpt index add9ebfdab..c6808afb63 100644 --- a/ext/phar/tests/tar/refcount1.phpt +++ b/ext/phar/tests/tar/refcount1.phpt @@ -9,61 +9,65 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', ""); +include dirname(__FILE__) . '/files/tarmaker.php.inc'; +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; +$alias = 'phar://' . $fname; +$tar = new tarmaker($fname, 'none'); +$tar->init(); +$tar->addFile('.phar/stub.php', ""); $files = array(); + $files['a.php'] = ''; $files['b.php'] = ''; $files['b/c.php'] = ''; $files['.phar/alias.txt'] = 'hio'; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $tar->addFile($n, $file); } -$a->close(); -$fp = fopen($pname . '/b/c.php', 'wb'); +$tar->close(); + +$fp = fopen($alias . '/b/c.php', 'wb'); fwrite($fp, "extra"); fclose($fp); echo "===CLOSE===\n"; -$p = new Phar($fname); -$b = fopen($pname . '/b/c.php', 'rb'); -$a = $p['b/c.php']; +$phar = new Phar($fname); +$b = fopen($alias . '/b/c.php', 'rb'); +$a = $phar['b/c.php']; var_dump($a); var_dump(fread($b, 20)); rewind($b); echo "===UNLINK===\n"; -unlink($pname . '/b/c.php'); +unlink($alias . '/b/c.php'); var_dump($a); var_dump(fread($b, 20)); -include $pname . '/b/c.php'; +include $alias . '/b/c.php'; + ?> ===DONE=== --CLEAN-- - + --EXPECTF-- ===CLOSE=== object(PharFileInfo)#%d (2) { ["pathName":"SplFileInfo":private]=> - string(%d) "phar://%srefcount1.phar.php/b" + string(%d) "phar://%srefcount1.phar.tar/b" ["fileName":"SplFileInfo":private]=> - string(%d) "phar://%srefcount1.phar.php/b/c.php" + string(%d) "phar://%srefcount1.phar.tar/b/c.php" } string(5) "extra" ===UNLINK=== -Warning: unlink(): phar error: "b/c.php" in phar "%srefcount1.phar.php", has open file pointers, cannot unlink in %srefcount1.php on line %d +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]=> - string(%d) "phar://%srefcount1.phar.php/b" + string(%d) "phar://%srefcount1.phar.tar/b" ["fileName":"SplFileInfo":private]=> - string(%s) "phar://%srefcount1.phar.php/b/c.php" + string(%s) "phar://%srefcount1.phar.tar/b/c.php" } string(5) "extra" extra diff --git a/ext/phar/tests/tar/rename.phpt b/ext/phar/tests/tar/rename.phpt index e3e3dfa984..96588a6596 100644 --- a/ext/phar/tests/tar/rename.phpt +++ b/ext/phar/tests/tar/rename.phpt @@ -7,33 +7,36 @@ phar.readonly=0 phar.require_hash=0 --FILE-- init(); -$a->addFile('.phar/stub.php', "init(); +$tar->addFile('.phar/stub.php', ""); $files = array(); $files['a'] = 'a'; + foreach ($files as $n => $file) { -$a->addFile($n, $file); + $tar->addFile($n, $file); } -$a->close(); + +$tar->close(); include $fname; -echo file_get_contents($pname . '/a') . "\n"; -rename($pname . '/a', $pname . '/b'); -echo file_get_contents($pname . '/b') . "\n"; -echo file_get_contents($pname . '/a') . "\n"; +echo file_get_contents($alias . '/a') . "\n"; +rename($alias . '/a', $alias . '/b'); +echo file_get_contents($alias . '/b') . "\n"; +echo file_get_contents($alias . '/a') . "\n"; ?> --CLEAN-- - + --EXPECTF-- a a -Warning: file_get_contents(phar://%srename.phar.php/a): failed to open stream: phar error: "a" is not a file in phar "%srename.phar.php" in %srename.php on line %d \ No newline at end of file +Warning: file_get_contents(phar://%srename.phar.tar/a): failed to open stream: phar error: "a" is not a file in phar "%srename.phar.tar" in %srename.php on line %d diff --git a/ext/phar/tests/tar/tar_001.phpt b/ext/phar/tests/tar/tar_001.phpt index c0e7ea308c..76242c89fb 100644 --- a/ext/phar/tests/tar/tar_001.phpt +++ b/ext/phar/tests/tar/tar_001.phpt @@ -5,18 +5,19 @@ Phar: tar-based phar corrupted --FILE-- init(); -$a->addFile('tar_001.phpt', __FILE__); -$a->close(); +include dirname(__FILE__) . '/files/make_invalid_tar.php.inc'; -$a = fopen('phar://' . dirname(__FILE__) . '/tar_001.phar/tar_001.phpt', 'rb'); +$tar = new corrupter(dirname(__FILE__) . '/tar_001.phar.tar', 'none'); +$tar->init(); +$tar->addFile('tar_001.phpt', __FILE__); +$tar->close(); + +$tar = fopen('phar://' . dirname(__FILE__) . '/tar_001.phar.tar/tar_001.phpt', 'rb'); try { -$a = new Phar(dirname(__FILE__) . '/tar_001.phar'); -echo "should not execute\n"; + $phar = new Phar(dirname(__FILE__) . '/tar_001.phar.tar'); + echo "should not execute\n"; } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== @@ -25,6 +26,6 @@ echo $e->getMessage() . "\n"; @unlink(dirname(__FILE__) . '/tar_001.phar'); ?> --EXPECTF-- -Warning: fopen(phar://%star_001.phar/tar_001.phpt): failed to open stream: phar error: "%star_001.phar" is a corrupted tar file in %star_001.php on line %d -Cannot open phar file '%star_001.phar' with alias '(null)': phar error: "%star_001.phar" is a corrupted tar file +Warning: fopen(phar://%star_001.phar.tar/tar_001.phpt): failed to open stream: phar error: "%star_001.phar.tar" is a corrupted tar file in %star_001.php on line %d +Cannot open phar file '%star_001.phar.tar' with alias '(null)': phar error: "%star_001.phar.tar" is a corrupted tar file ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/tar/tar_002.phpt b/ext/phar/tests/tar/tar_002.phpt index b9e4c59392..2674e416b8 100644 --- a/ext/phar/tests/tar/tar_002.phpt +++ b/ext/phar/tests/tar/tar_002.phpt @@ -7,26 +7,28 @@ Phar: tar-based phar corrupted 2 phar.readonly=0 --FILE-- init(); -$a->addFile('tar_002.phpt', __FILE__); -$a->close(); +include dirname(__FILE__) . '/files/make_invalid_tar.php.inc'; + +$tar = new corrupter(dirname(__FILE__) . '/tar_002.phar.tar', 'none'); +$tar->init(); +$tar->addFile('tar_002.phpt', __FILE__); +$tar->close(); + +$tar = fopen('phar://' . dirname(__FILE__) . '/tar_002.phar.tar/tar_002.phpt', 'rb'); -$a = fopen('phar://' . dirname(__FILE__) . '/tar_002.phar/tar_002.phpt', 'rb'); try { -$a = new Phar(dirname(__FILE__) . '/tar_002.phar'); -echo "should not execute\n"; + $phar = new Phar(dirname(__FILE__) . '/tar_002.phar.tar'); + echo "should not execute\n"; } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%star_002.phar/tar_002.phpt): failed to open stream: phar error: "%star_002.phar" is a corrupted tar file in %star_002.php on line %d -Cannot open phar file '%star_002.phar' with alias '(null)': phar error: "%star_002.phar" is a corrupted tar file +Warning: fopen(phar://%star_002.phar.tar/tar_002.phpt): failed to open stream: phar error: "%star_002.phar.tar" is a corrupted tar file in %star_002.php on line %d +Cannot open phar file '%star_002.phar.tar' with alias '(null)': phar error: "%star_002.phar.tar" is a corrupted tar file ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/tar/tar_003.phpt b/ext/phar/tests/tar/tar_003.phpt index b8e5f41d82..e7beecb55c 100644 --- a/ext/phar/tests/tar/tar_003.phpt +++ b/ext/phar/tests/tar/tar_003.phpt @@ -7,41 +7,45 @@ Phar: tar-based phar, valid 1 phar.readonly=0 --FILE-- init(); -$a->addFile('tar_003.phpt', $g = fopen(__FILE__, 'r')); -$a->addFile('internal/file/here', "hi there!\n"); -$a->mkDir('internal/dir'); -$a->mkDir('dir'); -$a->close(); +include dirname(__FILE__) . '/files/tarmaker.php.inc'; + +$fname = dirname(__FILE__) . '/tar_003.phar.tar'; +$alias = 'phar://' . $fname; + +$tar = new tarmaker($fname, 'none'); +$tar->init(); +$tar->addFile('tar_003.phpt', $g = fopen(__FILE__, 'r')); +$tar->addFile('internal/file/here', "hi there!\n"); +$tar->mkDir('internal/dir'); +$tar->mkDir('dir'); +$tar->close(); + fclose($g); -echo file_get_contents($pname . '/internal/file/here'); -$a = opendir($pname . '/'); -while (false !== ($v = readdir($a))) { - echo (is_file($pname . '/' . $v) ? "file\n" : "dir\n"); +echo file_get_contents($alias . '/internal/file/here'); + +$tar = opendir($alias . '/'); + +while (false !== ($v = readdir($tar))) { + echo (is_file($alias . '/' . $v) ? "file\n" : "dir\n"); echo $v . "\n"; } -closedir($a); +closedir($tar); /* ensure none of the dir tar files were freed */ echo "second round\n"; -$a = opendir($pname . '/'); -while (false !== ($v = readdir($a))) { - echo (is_file($pname . '/' . $v) ? "file\n" : "dir\n"); +$tar = opendir($alias . '/'); +while (false !== ($v = readdir($tar))) { + echo (is_file($alias . '/' . $v) ? "file\n" : "dir\n"); echo $v . "\n"; } -closedir($a); +closedir($tar); ?> ===DONE=== --CLEAN-- --EXPECT-- hi there! diff --git a/ext/phar/tests/tar/tar_004.phpt b/ext/phar/tests/tar/tar_004.phpt index 63a3dd8b91..2dd7ba169f 100644 --- a/ext/phar/tests/tar/tar_004.phpt +++ b/ext/phar/tests/tar/tar_004.phpt @@ -7,31 +7,32 @@ Phar: tar-based phar, tar phar with stub, mapPhar() phar.readonly=0 --FILE-- init(); -$a->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); -$a->mkDir('internal/dir'); -$a->mkDir('dir'); -$a->addFile('.phar/stub.php', 'init(); +$tar->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); +$tar->mkDir('internal/dir'); +$tar->mkDir('dir'); +$tar->addFile('.phar/stub.php', 'close(); +$tar->close(); include $fname; ?> ===DONE=== --CLEAN-- --EXPECTF-- string(9) "it worked" -string(%d) "phar://%star_004.phar/tar_004.php" +string(%d) "phar://%star_004.phar.tar/tar_004.php" ===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/tar/tar_bz2.phpt b/ext/phar/tests/tar/tar_bz2.phpt index 65f062261f..8c34fbc98a 100644 --- a/ext/phar/tests/tar/tar_bz2.phpt +++ b/ext/phar/tests/tar/tar_bz2.phpt @@ -8,33 +8,37 @@ Phar: tar-based phar, bzipped tar phar.readonly=0 --FILE-- init(); -$a->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); -$a->mkDir('internal/dir'); -$a->mkDir('dir'); -$a->addFile('.phar/stub.php', 'init(); +$tar->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); +$tar->mkDir('internal/dir'); +$tar->mkDir('dir'); +$tar->addFile('.phar/stub.php', 'close(); +$tar->close(); include $fname; -$a = new Phar($fname); -$a['test'] = 'hi'; +$phar = new Phar($fname); +$phar['test'] = 'hi'; + copy($fname, $fname2); -$b = new Phar($fname2); -var_dump($b->isTar()); -var_dump($b->isCompressed() == Phar::BZ2); + +$phar2 = new Phar($fname2); +var_dump($phar2->isTar()); +var_dump($phar2->isCompressed() == Phar::BZ2); + ?> ===DONE=== --CLEAN-- diff --git a/ext/phar/tests/tar/tar_gzip.phpt b/ext/phar/tests/tar/tar_gzip.phpt index 9fccc79226..a7fcb7c228 100644 --- a/ext/phar/tests/tar/tar_gzip.phpt +++ b/ext/phar/tests/tar/tar_gzip.phpt @@ -9,7 +9,7 @@ Phar: tar-based phar, gzipped tar phar.readonly=0 --FILE-- isTar()); +$phar->compressAllFilesBZIP2(); -$a = new Phar($fname); -$a['test'] = 'hi'; -var_dump($a->isTar()); -$a->compressAllFilesBZIP2(); copy($fname, $fname2); -$b = new Phar($fname2); -var_dump($b->isTar()); -var_dump($b->isCompressed() == Phar::BZ2); + +$phar2 = new Phar($fname2); +var_dump($phar2->isTar()); +var_dump($phar2->isCompressed() == Phar::BZ2); + ?> ===DONE=== --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/phar/tests/tar/tar_makegz.phpt b/ext/phar/tests/tar/tar_makegz.phpt index bf5c065d83..280c51a762 100644 --- a/ext/phar/tests/tar/tar_makegz.phpt +++ b/ext/phar/tests/tar/tar_makegz.phpt @@ -8,26 +8,29 @@ Phar: tar-based phar, make new gzipped tar phar.readonly=0 --FILE-- isTar()); +$phar->compressAllFilesGZ(); -$a = new Phar($fname); -$a['test'] = 'hi'; -var_dump($a->isTar()); -$a->compressAllFilesGZ(); copy($fname, $fname2); -$b = new Phar($fname2); -var_dump($b->isTar()); -var_dump($b->isCompressed() == Phar::GZ); + +$phar2 = new Phar($fname2); +var_dump($phar2->isTar()); +var_dump($phar2->isCompressed() == Phar::GZ); + ?> ===DONE=== --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/phar/tests/tar/tar_nostub.phpt b/ext/phar/tests/tar/tar_nostub.phpt index 9b330251b4..fa4b96ebf1 100644 --- a/ext/phar/tests/tar/tar_nostub.phpt +++ b/ext/phar/tests/tar/tar_nostub.phpt @@ -1,5 +1,5 @@ --TEST-- -Phar: tar-based phar, externally created tar with no stub, Phar->getStub() +Phar: tar-based phar, third-party tar with no stub, Phar->getStub() --SKIPIF-- @@ -7,18 +7,19 @@ Phar: tar-based phar, externally created tar with no stub, Phar->getStub() phar.readonly=1 --FILE-- init(); -$a->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); -$a->close(); +$tar = new tarmaker($fname, 'none'); +$tar->init(); +$tar->addFile('tar_004.php', 'addFile('internal/file/here', "hi there!\n"); +$tar->close(); + +$phar = new Phar($fname); +var_dump($phar->getStub()); -$b = new Phar($fname); -var_dump($b->getStub()); ?> ===DONE=== --CLEAN-- @@ -27,4 +28,4 @@ var_dump($b->getStub()); ?> --EXPECTF-- string(0) "" -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/phar/tests/tar/tarmaker.php.inc b/ext/phar/tests/tar/tarmaker.php.inc deleted file mode 100644 index 902507881a..0000000000 --- a/ext/phar/tests/tar/tarmaker.php.inc +++ /dev/null @@ -1,169 +0,0 @@ -compress = $compress; - if ($compress === 'bz2' && !function_exists('bzopen')) { - throw new PEAR2_Pyrus_Developer_Creator_Exception( - 'bzip2 extension not available'); - } - if ($compress === 'zlib' && !function_exists('gzopen')) { - throw new PEAR2_Pyrus_Developer_Creator_Exception( - 'zlib extension not available'); - } - $this->path = $path; - } - - /** - * save a file inside this package - * - * This code is modified from Vincent Lascaux's File_Archive - * package, which is licensed under the LGPL license. - * @param string relative path within the package - * @param string|resource file contents or open file handle - */ - function addFile($path, $fileOrStream, $stat = null) - { - clearstatcache(); - if ($stat === null) { - if (is_resource($fileOrStream)) { - $stat = fstat($fileOrStream); - } else { - $stat = array( - 'mode' => 0x8000 + 0644, - 'uid' => 0, - 'gid' => 0, - 'size' => strlen($fileOrStream), - 'mtime' => time(), - ); - } - } - - $link = null; - if ($stat['mode'] & 0x4000) { - $type = 5; // Directory - } else if ($stat['mode'] & 0x8000) { - $type = 0; // Regular - } else if ($stat['mode'] & 0xA000) { - $type = 1; // Link - $link = @readlink($current); - } else { - $type = 9; // Unknown - } - - $filePrefix = ''; - if (strlen($path) > 255) { - throw new Exception( - "$path is too long, must be 255 characters or less" - ); - } else if (strlen($path) > 100) { - $filePrefix = substr($path, 0, strlen($path)-100); - $path = substr($path, -100); - } - - $block = pack('a100a8a8a8a12A12', - $path, - decoct($stat['mode']), - sprintf('%6s ',decoct($stat['uid'])), - sprintf('%6s ',decoct($stat['gid'])), - sprintf('%11s ',decoct($stat['size'])), - sprintf('%11s ',decoct($stat['mtime'])) - ); - - $blockend = pack('a1a100a6a2a32a32a8a8a155a12', - $type, - $link, - 'ustar', - '00', - 'Pyrus', - 'Pyrus', - '', - '', - $filePrefix, - ''); - - $checkheader = array_merge(str_split($block), str_split($blockend)); - if (!function_exists('_pear2tarchecksum')) { - function _pear2tarchecksum($a, $b) {return $a + ord($b);} - } - $checksum = 256; // 8 * ord(' '); - $checksum += array_reduce($checkheader, '_pear2tarchecksum'); - - $checksum = pack('a8', sprintf('%6s ', decoct($checksum))); - - fwrite($this->tmp, $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)); - } - } else { - fwrite($this->tmp, $fileOrStream); - if (strlen($fileOrStream) % 512) { - fwrite($this->tmp, str_repeat("\0", 512 - strlen($fileOrStream) % 512)); - } - } - } - - /** - * Initialize the package creator - */ - function init() - { - switch ($this->compress) { - case 'zlib' : - $this->tmp = gzopen($this->path, 'wb'); - break; - case 'bz2' : - $this->tmp = bzopen($this->path, 'w'); - break; - case 'none' : - $this->tmp = fopen($this->path, 'wb'); - break; - default : - throw new Exception( - 'unknown compression type ' . $this->compress); - } - } - - /** - * Create an internal directory, creating parent directories as needed - * - * @param string $dir - */ - function mkdir($dir) - { - $this->addFile($dir, "", array( - 'mode' => 0x4000 + 0644, - 'uid' => 0, - 'gid' => 0, - 'size' => 0, - 'mtime' => time(), - )); - } - - /** - * Finish saving the package - */ - function close() - { - fwrite($this->tmp, pack('a1024', '')); - fclose($this->tmp); - } -} \ No newline at end of file -- 2.40.0