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 Unicode support 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_004U.phar.tar'; 17$alias = 'phar://' . $fname; 18 19$tar = new tarmaker($fname, 'none'); 20$tar->init(); 21$tar->addFile('tar_004U.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_004U.php"; 29'); 30$tar->close(); 31 32include $fname; 33?> 34===DONE=== 35--CLEAN-- 36<?php 37@unlink(dirname(__FILE__) . '/tar_004U.phar.tar'); 38?> 39--EXPECTF-- 40unicode(9) "it worked" 41unicode(%d) "phar://%star_004U.phar.tar/tar_004U.php" 42===DONE===