Annotation of embedaddon/php/ext/phar/tests/tar/tar_004.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: tar-based phar, tar phar with stub, mapPhar()
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (version_compare(PHP_VERSION, "6.0", ">")) die("skip pre-unicode version of PHP required");
7: if (!extension_loaded("spl")) die("skip SPL not available");
8: ?>
9: --INI--
10: phar.readonly=0
11: phar.require_hash=0
12: --FILE--
13: <?php
14: include dirname(__FILE__) . '/files/tarmaker.php.inc';
15:
16: $fname = dirname(__FILE__) . '/tar_004.phar.tar';
17: $alias = 'phar://' . $fname;
18:
19: $tar = new tarmaker($fname, 'none');
20: $tar->init();
21: $tar->addFile('tar_004.php', '<?php var_dump(__FILE__);');
22: $tar->addFile('internal/file/here', "hi there!\n");
23: $tar->mkDir('internal/dir');
24: $tar->mkDir('dir');
25: $tar->addFile('.phar/stub.php', '<?php
26: Phar::mapPhar();
27: var_dump("it worked");
28: include "phar://" . __FILE__ . "/tar_004.php";
29: ');
30: $tar->close();
31:
32: include $fname;
33: ?>
34: ===DONE===
35: --CLEAN--
36: <?php
37: @unlink(dirname(__FILE__) . '/tar_004.phar.tar');
38: ?>
39: --EXPECTF--
40: string(9) "it worked"
41: string(%d) "phar://%star_004.phar.tar/tar_004.php"
42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>