]> granicus.if.org Git - php/commitdiff
- Update tests
authorMarcus Boerger <helly@php.net>
Wed, 4 Jan 2006 16:43:42 +0000 (16:43 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 4 Jan 2006 16:43:42 +0000 (16:43 +0000)
17 files changed:
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/016.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

index 254e7e8e0041cea4be2981dc9aa9ad7bec26536d..125d1a9a315cbf49d52efaba6b1829c75ce7652b 100644 (file)
@@ -4,14 +4,14 @@ Phar::mapPhar truncated manifest (not enough for manifest length)
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar(5, 'hio', false);
 __HALT_COMPILER(); ?>";
 $file .= pack('V', 500) . 'notenough';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Fatal error: Phar::mapPhar(): internal corruption of phar "%s" (truncated manifest) in %s on line %d
\ No newline at end of file
index 4667c980ef27193d83c07f15fc3855eac9e9a7e8..476b41a11247797e12d968e8069f7cc93b3c2a58 100644 (file)
@@ -4,14 +4,14 @@ Phar::mapPhar too many manifest entries
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar(5, 'hio', false);
 __HALT_COMPILER(); ?>";
 $file .= pack('VV', 500, 500) . str_repeat('A', 500);
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Fatal error: Phar::mapPhar(): too many manifest entries for size of manifest in phar "%s" in %s on line %d
\ No newline at end of file
index 9560e08f59a8358a02f3f0f96be20ad6bb3e4f7b..e308acb940c7401ae6392d508c9caf35f05e482a 100644 (file)
@@ -4,17 +4,17 @@ Phar::mapPhar buffer overrun
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar(5, 'hio', false);
 __HALT_COMPILER(); ?>";
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 1);
 // this fails because the manifest length does not include the 4-byte "length of manifest" data
 $file .= pack('VV', strlen($manifest), 1) . $manifest . pack('VV', crc32('a'), 1) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Fatal error: Phar::mapPhar(): internal corruption of phar "%s" (buffer overrun) in %s on line %d
\ No newline at end of file
index 3738e66c57b1dec4d08b49876fce9a2523985104..db1af1844e44f958066e5fa82b6766b6b33015e1 100644 (file)
@@ -4,17 +4,17 @@ Phar::mapPhar filesize too small in manifest
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar(5, 'hio', false);
 __HALT_COMPILER(); ?>";
 // compressed file length does not include 8 bytes for crc/file length and should
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 1);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Fatal error: Phar::mapPhar(): internal corruption of phar "%s" (file size in phar is not large enough) in %s on line %d
\ No newline at end of file
index 0dd9fdafe65feca3a5e74729ee8c66b91e98cda6..0e05d8693694e1d75a05d941292827c253ddc484 100644 (file)
@@ -4,16 +4,16 @@ Phar::mapPhar valid file
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 a
\ No newline at end of file
index 1cd95a5df163ef4024f91238f31514c5f0d12f80..0dccce4ccfdf481e730bb764e6475e2736ea69fe 100644 (file)
@@ -4,17 +4,17 @@ Phar::mapPhar filesize mismatch
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
 // filesize should be 1, and is 2
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 2) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: internal corruption of phar "%s" (filesize mismatch on file "a") in %s on line 12
\ No newline at end of file
+Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: internal corruption of phar "%s" (filesize mismatch on file "a") in %s on line %d
index a201f8c60a1eee5c25783d4d9ace1db5111a12b5..d930b72cf3b94475ff677a21761bfd8a11577859 100644 (file)
@@ -4,17 +4,17 @@ Phar::mapPhar filesize mismatch
 <?php if (!extension_loaded("phar")) print "skip";?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
 // wrong crc32
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('b'), 1) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line 12
\ No newline at end of file
+Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d
\ No newline at end of file
index f6de045cb615de24e1ffbac2ea26aaec44da2d1d..846f44c563750be0d9c99de05d56a1f7b5d892e0 100644 (file)
@@ -5,16 +5,16 @@ Phar::mapPhar valid file (gzipped)
 if (!PHP_Archive::canCompress()) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 11);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . chr(75) . chr(4) . chr(0); // 'a' gzdeflated
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 a
\ No newline at end of file
index 58d7671af360b448ada0869464d7c19b6fd5ea66..42f9af83b3d23552a63360577ee7027d00586e7d 100644 (file)
@@ -5,17 +5,17 @@ Phar::mapPhar invalid file (gzipped file length is too short)
 if (!PHP_Archive::canCompress()) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
 // file length is too short
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . chr(0) . chr(4) . chr(0); // 'a' gzdeflated
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 echo file_get_contents('phar://hio/a');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: decompression failed in %s on line %d
\ No newline at end of file
index cac6023c0fc4d616e26b03e13ea3c5018d2d4f42..01626039ca7b2db6c2ff5916c42b22ff07e4d310 100644 (file)
@@ -4,17 +4,17 @@ Phar: opendir test - no dir specified at all
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
 // file length is too short
 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
 $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . 'a';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $dir = opendir('phar://hio');
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 Warning: opendir(phar://hio): failed to open dir: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory in %s on line %d
\ No newline at end of file
index 1032afe4bf6a3ef810ee95150e5a34e9f104fffb..664fde6f4596b56f7c42e4d36a52e916aca79f70 100644 (file)
@@ -4,8 +4,6 @@ Phar: opendir test, root directory
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
@@ -16,14 +14,16 @@ $file .= pack('VV', strlen($manifest) + 4, 2) .
         $manifest .
         pack('VV', crc32('a'), 1) . 'a' .
         pack('VV', crc32('b'), 1) . 'b';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $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'); ?>
 --EXPECT--
 string(1) "a"
 bool(false)
index 8ff74ef7b29006bc36513ad5f8a5963906733814..0b6bba97b9c68ff7eeb22dd1d90ad89ee3f8f47c 100644 (file)
@@ -4,8 +4,6 @@ Phar: opendir test, subdirectory
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
@@ -20,14 +18,16 @@ $file .= pack('VV', strlen($manifest) + 4, 4) .
         pack('VV', crc32('b'), 1) . 'b';
         pack('VV', crc32('c'), 1) . 'c';
         pack('VV', crc32('d'), 1) . 'd';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $dir = opendir('phar://hio/b');
 while (false !== ($a = readdir($dir))) {
        var_dump($a);
        var_dump(is_dir('phar://hio/b/' . $a));
 }
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 string(1) "a"
 bool(false)
index 218e5193799415afd5e67cc65d41907708112033..8c8bb09442e195eeaa0eda220d42e280119ae843 100755 (executable)
@@ -4,8 +4,6 @@ Phar: opendir test, recurse into
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', true);
 __HALT_COMPILER(); ?>";
@@ -20,8 +18,8 @@ $file .= pack('VV', strlen($manifest) + 4, 4) .
         pack('VV', crc32('b'), 1) . 'b';
         pack('VV', crc32('c'), 1) . 'c';
         pack('VV', crc32('d'), 1) . 'd';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 
 function dump($phar, $base)
 {
@@ -45,6 +43,8 @@ function dump($phar, $base)
 dump('phar://hio', '/');
 
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 string(11) "phar://hio/"
 string(2) "/a"
index 0e690a97cdae3acca315e69e1a83f23b4de61a32..e940038419c3852bfbd05ff1ebf11eb8c2e69834 100755 (executable)
@@ -18,8 +18,8 @@ $file .= pack('VV', strlen($manifest) + 4, 4) .
         pack('VV', crc32('b'), 1) . 'b' .
         pack('VV', crc32('c'), 1) . 'c' .
         pack('VV', crc32('d'), 1) . 'd';
-file_put_contents(dirname(__FILE__) . '/019c.phar.php', $file);
-include dirname(__FILE__) . '/019c.phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 
 function dump($phar, $base)
 {
@@ -48,7 +48,7 @@ dump('phar://hio', '/');
 
 ?>
 --CLEAN--
-<?php unlink(dirname(__FILE__) . '/019c.phar.php'); ?>
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 string(11) "phar://hio/"
 string(2) "/a"
index e97463e6970b8bbb9cd66993074e14821c1752df..64c5a71f8e32e88bd912df53649c086704660c9f 100644 (file)
@@ -4,8 +4,6 @@ Phar: url stat
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
@@ -20,10 +18,12 @@ $file .= pack('VV', strlen($manifest) + 4, 4) .
         pack('VV', crc32('b'), 1) . 'b';
         pack('VV', crc32('c'), 1) . 'c';
         pack('VV', crc32('d'), 1) . 'd';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 var_dump(stat('phar://hio/a'), stat('phar://hio/b'));
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 array(26) {
   [0]=>
index 791e0fc4e589b27e100617869ca3e400d471c1b9..5bfced3bd0f16a5c24e9180351ecc6cf65259ac0 100644 (file)
@@ -4,8 +4,6 @@ Phar: stream stat
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
@@ -20,12 +18,14 @@ $file .= pack('VV', strlen($manifest) + 4, 4) .
         pack('VV', crc32('b'), 1) . 'b';
         pack('VV', crc32('c'), 1) . 'c';
         pack('VV', crc32('d'), 1) . 'd';
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $fp = fopen('phar://hio/a', 'r');
 var_dump(fstat($fp));
 fclose($fp);
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 array(26) {
   [0]=>
index e2769e4b46c30e6c2dc54e95c3eb491db7f8cf2c..d1c83eb20a5509e180294f80f44b88831e8dc91d 100644 (file)
@@ -4,8 +4,6 @@ Phar: stream stat
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 --FILE--
 <?php
-function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
-register_shutdown_function('cleanup');
 $file = "<?php
 Phar::mapPhar('hio', false);
 __HALT_COMPILER(); ?>";
@@ -14,8 +12,8 @@ $manifest = pack('V', 1) . 'a' . pack('VVVV', strlen($contents), time(), 0, 8 +
 $file .= pack('VV', strlen($manifest) + 4, 1) .
         $manifest .
         pack('VV', crc32($contents), strlen($contents)) . $contents;
-file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
-include dirname(__FILE__) . '/008_phar.php';
+file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
+include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
 $fp = fopen('phar://hio/a', 'r');
 var_dump(ftell($fp));
 echo 'fseek($fp, 1)';var_dump(fseek($fp, 1));
@@ -61,6 +59,8 @@ echo 'fseek($fp, 3, SEEK_CUR)';var_dump(fseek($fp, 3, SEEK_CUR));
 var_dump(ftell($fp));
 fclose($fp);
 ?>
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECT--
 int(0)
 fseek($fp, 1)int(0)
@@ -100,13 +100,3 @@ int(0)
 int(4)
 fseek($fp, 3, SEEK_CUR)int(0)
 int(7)
-
-
-
-
-
-
-
-
-
-