Annotation of embedaddon/php/ext/phar/tests/tar/phar_magic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: include/fopen magic tar-based
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.tar.php';
11: $p = new Phar($fname);
12: var_dump($p->isFileFormat(Phar::TAR));
13: $p['a'] = '<?php include "b/c.php";' . "\n";
14: $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";';
15: $p['d'] = "in d\n";
16: $p->setStub('<?php
17: set_include_path("phar://" . __FILE__);
18: if (version_compare(PHP_VERSION, "5.3", "<")) {
19: Phar::interceptFileFuncs();
20: }
21: include "phar://" . __FILE__ . "/a";
22: __HALT_COMPILER();');
23: include $fname;
24: ?>
25: ===DONE===
26: --CLEAN--
27: <?php
28: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar.php');
29: __HALT_COMPILER();
30: ?>
31: --EXPECTF--
32: bool(true)
33: in b
34: <?php include "b/c.php";
35: in d
36: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>