xref: /PHP-5.3/ext/phar/tests/tar/tar_004.phpt (revision 377ff97a)
1--TEST--
2Phar: tar-based phar, tar phar with stub, mapPhar()
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6if (version_compare(PHP_VERSION, "6.0", ">")) die("skip pre-unicode version of PHP required");
7if (!extension_loaded("spl")) die("skip SPL not available");
8?>
9--INI--
10phar.readonly=0
11phar.require_hash=0
12--FILE--
13<?php
14include 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
26Phar::mapPhar();
27var_dump("it worked");
28include "phar://" . __FILE__ . "/tar_004.php";
29');
30$tar->close();
31
32include $fname;
33?>
34===DONE===
35--CLEAN--
36<?php
37@unlink(dirname(__FILE__) . '/tar_004.phar.tar');
38?>
39--EXPECTF--
40string(9) "it worked"
41string(%d) "phar://%star_004.phar.tar/tar_004.php"
42===DONE===