xref: /PHP-5.3/ext/phar/tests/020.phpt (revision 228c2886)
1--TEST--
2Phar: url stat
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7detect_unicode=0
8--FILE--
9<?php
10$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11$pname = 'phar://' . $fname;
12$file = b"<?php
13Phar::mapPhar('hio');
14__HALT_COMPILER(); ?>";
15
16$pfile = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
17$files = array();
18$files['a'] = 'a';
19$files['b/a'] = 'b';
20$files['b/c/d'] = 'c';
21$files['bad/c'] = 'd';
22include 'files/phar_test.inc';
23include $fname;
24
25var_dump(stat('phar://hio/a'), stat('phar://hio/b'));
26?>
27--CLEAN--
28<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29--EXPECTF--
30array(26) {
31  [0]=>
32  int(12)
33  [1]=>
34  int(%d)
35  [2]=>
36  int(33060)
37  [3]=>
38  int(1)
39  [4]=>
40  int(0)
41  [5]=>
42  int(0)
43  [6]=>
44  int(-1)
45  [7]=>
46  int(1)
47  [8]=>
48  int(%d)
49  [9]=>
50  int(%d)
51  [10]=>
52  int(%d)
53  [11]=>
54  int(-1)
55  [12]=>
56  int(-1)
57  [%sdev"]=>
58  int(12)
59  [%sino"]=>
60  int(%d)
61  [%smode"]=>
62  int(33060)
63  [%snlink"]=>
64  int(1)
65  [%suid"]=>
66  int(0)
67  [%sgid"]=>
68  int(0)
69  [%srdev"]=>
70  int(-1)
71  [%ssize"]=>
72  int(1)
73  [%satime"]=>
74  int(%d)
75  [%smtime"]=>
76  int(%d)
77  [%sctime"]=>
78  int(%d)
79  [%sblksize"]=>
80  int(-1)
81  [%sblocks"]=>
82  int(-1)
83}
84array(26) {
85  [0]=>
86  int(12)
87  [1]=>
88  int(%d)
89  [2]=>
90  int(16749)
91  [3]=>
92  int(1)
93  [4]=>
94  int(0)
95  [5]=>
96  int(0)
97  [6]=>
98  int(-1)
99  [7]=>
100  int(0)
101  [8]=>
102  int(%d)
103  [9]=>
104  int(%d)
105  [10]=>
106  int(%d)
107  [11]=>
108  int(-1)
109  [12]=>
110  int(-1)
111  [%sdev"]=>
112  int(12)
113  [%sino"]=>
114  int(%d)
115  [%smode"]=>
116  int(16749)
117  [%snlink"]=>
118  int(1)
119  [%suid"]=>
120  int(0)
121  [%sgid"]=>
122  int(0)
123  [%srdev"]=>
124  int(-1)
125  [%ssize"]=>
126  int(0)
127  [%satime"]=>
128  int(%d)
129  [%smtime"]=>
130  int(%d)
131  [%sctime"]=>
132  int(%d)
133  [%sblksize"]=>
134  int(-1)
135  [%sblocks"]=>
136  int(-1)
137}
138