1--TEST--
2Phar: rename_dir and mount test
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7phar.require_hash=0
8--FILE--
9<?php
10$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11$pname = 'phar://' . $fname;
12$file = "<?php
13Phar::mapPhar('hio');
14__HALT_COMPILER(); ?>";
15
16$files = array();
17$files['a/x'] = 'a';
18$files['a/b/x'] = 'a';
19include 'files/phar_test.inc';
20include $fname;
21
22Phar::mount("$pname/a/c", dirname(__FILE__));
23
24var_dump(file_exists($pname . '/a'));
25var_dump(file_exists($pname . '/a/x'));
26var_dump(file_exists($pname . '/a/b'));
27var_dump(file_exists($pname . '/a/b/x'));
28var_dump(file_exists($pname . '/a/c'));
29var_dump(file_exists($pname . '/a/c/'.basename(__FILE__)));
30rename($pname . '/a', $pname . '/b');
31clearstatcache();
32var_dump(file_exists($pname . '/a'));
33var_dump(file_exists($pname . '/a/x'));
34var_dump(file_exists($pname . '/a/b'));
35var_dump(file_exists($pname . '/a/b/x'));
36var_dump(file_exists($pname . '/a/c'));
37var_dump(file_exists($pname . '/a/c/'.basename(__FILE__)));
38var_dump(file_exists($pname . '/b'));
39var_dump(file_exists($pname . '/b/x'));
40var_dump(file_exists($pname . '/b/b'));
41var_dump(file_exists($pname . '/b/b/x'));
42var_dump(file_exists($pname . '/b/c'));
43var_dump(file_exists($pname . '/b/c/'.basename(__FILE__)));
44?>
45--CLEAN--
46<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
47--EXPECT--
48bool(true)
49bool(true)
50bool(true)
51bool(true)
52bool(true)
53bool(true)
54bool(false)
55bool(false)
56bool(false)
57bool(false)
58bool(false)
59bool(false)
60bool(true)
61bool(true)
62bool(true)
63bool(true)
64bool(true)
65bool(true)
66