Annotation of embedaddon/php/ext/phar/tests/phar_magic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: include/fopen magic
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.require_hash=0
7: phar.readonly=0
8: --FILE--
9: <?php
10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11: $p = new Phar($fname);
12: $p['a'] = '<?php include "b/c.php";' . "\n";
13: $p['b/c.php'] = '<?php echo "in b\n";$a = fopen("a", "r", true);echo stream_get_contents($a);fclose($a);include dirname(__FILE__) . "/../d";';
14: $p['d'] = "in d\n";
15: $p->setStub('<?php
16: set_include_path("phar://" . __FILE__);
17: if (version_compare(PHP_VERSION, "5.3", "<")) {
18: Phar::interceptFileFuncs();
19: }
20: include "phar://" . __FILE__ . "/a";
21: __HALT_COMPILER();');
22: include $fname;
23: ?>
24: ===DONE===
25: --CLEAN--
26: <?php
27: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
28: __HALT_COMPILER();
29: ?>
30: --EXPECTF--
31: in b
32: <?php include "b/c.php";
33: in d
34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>