1--TEST--
2Phar: delete a file within a .phar (confirm disk file is changed)
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7phar.require_hash=0
8opcache.validate_timestamps=1
9--FILE--
10<?php
11$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
12$pname = 'phar://' . $fname;
13$file = "<?php __HALT_COMPILER(); ?>";
14
15$files = array();
16$files['a.php'] = '<?php echo "This is a\n"; ?>';
17$files['b.php'] = '<?php echo "This is b\n"; ?>';
18$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
19
20include 'files/phar_test.inc';
21
22include $pname . '/a.php';
23include $pname . '/b.php';
24include $pname . '/b/c.php';
25$md5 = md5_file($fname);
26unlink($pname . '/b/c.php');
27clearstatcache();
28$md52 = md5_file($fname);
29if ($md5 == $md52) echo 'file was not modified';
30?>
31===AFTER===
32<?php
33include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
34include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/b.php';
35include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/b/c.php';
36?>
37
38--CLEAN--
39<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
40--EXPECTF--
41This is a
42This is b
43This is b/c
44===AFTER===
45This is a
46This is b
47
48Warning: include(%sdelete_in_phar_confirm.phar.php/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d
49
50Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d
51
52