Annotation of embedaddon/php/ext/phar/tests/tar/delete_in_phar_b.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: delete a file within a tar-based .phar
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.readonly=0
7: phar.require_hash=0
8: --FILE--
9: <?php
10:
11: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
12: $alias = 'phar://' . $fname;
13:
14: $phar = new Phar($fname);
15: $phar['a.php'] = '<?php echo "This is a\n"; ?>';
16: $phar['b.php'] = '<?php echo "This is b\n"; ?>';
17: $phar['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18: $phar->setStub('<?php __HALT_COMPILER(); ?>');
19: $phar->stopBuffering();
20: ini_set('phar.readonly', 1);
21:
22: include $alias . '/a.php';
23: include $alias . '/b.php';
24: include $alias . '/b/c.php';
25: unlink($alias . '/b/c.php');
26:
27: ?>
28: ===AFTER===
29: <?php
30: include $alias . '/a.php';
31: include $alias . '/b.php';
32: include $alias . '/b/c.php';
33: ?>
34:
35: ===DONE===
36: --CLEAN--
37: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
38: --EXPECTF--
39: This is a
40: This is b
41: This is b/c
42:
43: Warning: unlink(): phar error: write operations disabled by the php.ini setting phar.readonly in %sdelete_in_phar_b.php on line %d
44: ===AFTER===
45: This is a
46: This is b
47: This is b/c
48:
49: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>