Annotation of embedaddon/php/ext/phar/tests/019bU.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: opendir test, recurse into
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (version_compare(PHP_VERSION, "6.0", "<")) die("skip Unicode support required");
7: ?>
8: --INI--
9: phar.require_hash=0
10: --FILE--
11: <?php
12:
13: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
14: $pname = 'phar://' . $fname;
15: $file = b"<?php
16: Phar::mapPhar('hio');
17: __HALT_COMPILER(); ?>";
18:
19: $files = array();
20: $files['a'] = 'a';
21: $files['b/a'] = 'b';
22: $files['b/c/d'] = 'c';
23: $files['bad/c'] = 'd';
24:
25: include 'files/phar_test.inc';
26: include $fname;
27:
28: function dump($phar, $base)
29: {
30: var_dump($phar . $base);
31: $dir = opendir($phar . $base);
32: if ($base == '/')
33: {
34: $base = '';
35: }
36: while (false !== ($entry = readdir($dir))) {
37: $entry = $base . '/' . $entry;
38: var_dump($entry);
39: var_dump(is_dir($phar . $entry));
40: if (is_dir($phar . $entry))
41: {
42: dump($phar, $entry);
43: }
44: }
45: }
46:
47: dump('phar://hio', '/');
48:
49: ?>
50: --CLEAN--
51: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
52: --EXPECT--
53: unicode(11) "phar://hio/"
54: unicode(2) "/a"
55: bool(false)
56: unicode(2) "/b"
57: bool(true)
58: unicode(12) "phar://hio/b"
59: unicode(4) "/b/a"
60: bool(false)
61: unicode(4) "/b/c"
62: bool(true)
63: unicode(14) "phar://hio/b/c"
64: unicode(6) "/b/c/d"
65: bool(false)
66: unicode(4) "/bad"
67: bool(true)
68: unicode(14) "phar://hio/bad"
69: unicode(6) "/bad/c"
70: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>