File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Phar object: iterate test with sub-directories and RecursiveIteratorIterator
3
+ --SKIPIF--
4
+ <?php if (!extension_loaded ('phar ' )) die ('skip ' ); ?>
5
+ <?php if (!extension_loaded ("spl " )) print "skip SPL not available " ; ?>
6
+ --INI--
7
+ phar.readonly=0
8
+ phar.require_hash=0
9
+ --FILE--
10
+ <?php
11
+
12
+ $ phar = new Phar (dirname (__FILE__ ) . '/test.phar ' );
13
+ $ phar ['top.txt ' ] = 'hi ' ;
14
+ $ phar ['sub/top.txt ' ] = 'there ' ;
15
+ $ phar ['another.file.txt ' ] = 'wowee ' ;
16
+ $ newphar = new Phar (dirname (__FILE__ ) . '/test.phar ' );
17
+ foreach (new RecursiveIteratorIterator ($ newphar ) as $ path => $ obj ) {
18
+ var_dump ($ obj ->getPathName ());
19
+ }
20
+ ?>
21
+ ===DONE===
22
+ --CLEAN--
23
+ <?php
24
+ unlink (dirname (__FILE__ ) . '/test.phar ' );
25
+ __halt_compiler ();
26
+ ?>
27
+ --EXPECTF--
28
+ string(%d) "phar://%stest.phar/another.file.txt"
29
+ string(%d) "phar://%stest.phar/sub/top.txt"
30
+ string(%d) "phar://%stest.phar/top.txt"
31
+ ===DONE===
You can’t perform that action at this time.
0 commit comments