1--TEST--
2Phar: delete a file within a zip-based .phar
3--EXTENSIONS--
4phar
5--INI--
6phar.readonly=0
7phar.require_hash=0
8--FILE--
9<?php
10
11$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.zip';
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();
20ini_set('phar.readonly', 1);
21
22include $alias . '/a.php';
23include $alias . '/b.php';
24include $alias . '/b/c.php';
25unlink($alias . '/b/c.php');
26?>
27===AFTER===
28<?php
29include $alias . '/a.php';
30include $alias . '/b.php';
31include $alias . '/b/c.php';
32?>
33
34--CLEAN--
35<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
36--EXPECTF--
37This is a
38This is b
39This is b/c
40
41Warning: unlink(): phar error: write operations disabled by the php.ini setting phar.readonly in %sdelete_in_phar_b.php on line %d
42===AFTER===
43This is a
44This is b
45This is b/c
46
47