1--TEST--
2Phar: delete a file within a .phar
3--EXTENSIONS--
4phar
5--INI--
6phar.readonly=1
7phar.require_hash=0
8--FILE--
9<?php
10$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
11$pname = 'phar://' . $fname;
12$file = "<?php __HALT_COMPILER(); ?>";
13
14$files = array();
15$files['a.php'] = '<?php echo "This is a\n"; ?>';
16$files['b.php'] = '<?php echo "This is b\n"; ?>';
17$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
18include 'files/phar_test.inc';
19
20include $pname . '/a.php';
21include $pname . '/b.php';
22include $pname . '/b/c.php';
23unlink($pname . '/b/c.php');
24?>
25===AFTER===
26<?php
27include $pname . '/a.php';
28include $pname . '/b.php';
29include $pname . '/b/c.php';
30?>
31
32--CLEAN--
33<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
34--EXPECTF--
35This is a
36This is b
37This is b/c
38
39Warning: unlink(): phar error: write operations disabled by the php.ini setting phar.readonly in %sdelete_in_phar_b.php on line %d
40===AFTER===
41This is a
42This is b
43This is b/c
44
45