Annotation of embedaddon/php/ext/phar/tests/readfile.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: test readfile() interception
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip");?>
5: --INI--
6: phar.require_hash=1
7: phar.readonly=0
8: --FILE--
9: <?php
10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11: $a = new Phar($fname);
12: $a['index.php'] = '<?php
13: readfile("dir/file1.txt");
14: readfile("file1.txt", true);
15: ?>';
16: $a['dir/file1.txt'] = 'hi';
17: $a['dir/file2.txt'] = 'hi2';
18: $a['dir/file3.txt'] = 'hi3';
19: $a->setStub('<?php
20: Phar::interceptFileFuncs();
21: set_include_path("phar://" . __FILE__ . "/dir" . PATH_SEPARATOR . "phar://" . __FILE__);
22: include "index.php";
23: __HALT_COMPILER();');
24: include $fname;
25: ?>
26: ===DONE===
27: --CLEAN--
28: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29: --EXPECT--
30: hihi===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>