summaryrefslogtreecommitdiff
path: root/ext/phar/tests/open_for_write_existing.phpt
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-01-13 16:17:04 +0000
committerMarcus Boerger <helly@php.net>2007-01-13 16:17:04 +0000
commitc6c23145f466f4ed9756d9941b47efba1e436992 (patch)
tree08993ba65d10c5f72c657522c3ff6d3720dd4b77 /ext/phar/tests/open_for_write_existing.phpt
parentb1f02b95ceb649e7e8cb2dda3c96d8de61c73169 (diff)
downloadphp-git-c6c23145f466f4ed9756d9941b47efba1e436992.tar.gz
- Change to new layout wich has some more flags that will be used for perms
- Update/simplify tests
Diffstat (limited to 'ext/phar/tests/open_for_write_existing.phpt')
-rw-r--r--ext/phar/tests/open_for_write_existing.phpt21
1 files changed, 5 insertions, 16 deletions
diff --git a/ext/phar/tests/open_for_write_existing.phpt b/ext/phar/tests/open_for_write_existing.phpt
index 93a1539e93..a1ab33a6b7 100644
--- a/ext/phar/tests/open_for_write_existing.phpt
+++ b/ext/phar/tests/open_for_write_existing.phpt
@@ -7,31 +7,20 @@ phar.readonly=0
phar.require_hash=0
--FILE--
<?php
+$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
+$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
$files = array();
$files['a.php'] = '<?php echo "This is a\n"; ?>';
$files['b.php'] = '<?php echo "This is b\n"; ?>';
$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
-$manifest = '';
-foreach($files as $name => $cont) {
- $len = strlen($cont);
- $manifest .= pack('V', strlen($name)) . $name . pack('VVVVC', $len, time(), $len, crc32($cont), 0x00);
-}
-$alias = '';
-$manifest = pack('VnV', count($files), 0x0800, strlen($alias)) . $alias . $manifest;
-$file .= pack('V', strlen($manifest)) . $manifest;
-foreach($files as $cont)
-{
- $file .= $cont;
-}
+include 'phar_test.inc';
-file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
-
-$fp = fopen('phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/b/c.php', 'wb');
+$fp = fopen($pname . '/b/c.php', 'wb');
fwrite($fp, 'extra');
fclose($fp);
-include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/b/c.php';
+include $pname . '/b/c.php';
?>
===DONE===