--TEST-- Phar: mounted manifest directory test --SKIPIF-- ")) die("skip pre-unicode version of PHP required"); ?> --INI-- phar.readonly=0 detect_unicode=0 --FILE-- getMessage(),"\n"; } ?>'; $a['testit/existing.txt'] = 'oops'; $a->setStub(''); file_put_contents(dirname(__FILE__) . '/testit/extfile2.php', ''); include dirname(__FILE__) . '/testit/extfile.php'; include $fname; $a = opendir($pname . '/testit'); $out = array(); while (false !== ($b = readdir($a))) { $out[] = $b; } sort($out); foreach ($out as $b) { echo "$b\n"; } $out = array(); foreach (new Phar($pname . '/testit') as $b) { $out[] = $b->getPathName(); } sort($out); foreach ($out as $b) { echo "$b\n"; } try { Phar::mount($pname . '/testit', 'another\\..\\mistake'); } catch (Exception $e) { echo $e->getMessage(), "\n"; } try { Phar::mount($pname . '/notfound', dirname(__FILE__) . '/this/does/not/exist'); } catch (Exception $e) { echo $e->getMessage(), "\n"; } try { Phar::mount($pname . '/testit', dirname(__FILE__)); } catch (Exception $e) { echo $e->getMessage(), "\n"; } try { Phar::mount($pname . '/testit/extfile.php', dirname(__FILE__)); } catch (Exception $e) { echo $e->getMessage(), "\n"; } ?> ===DONE=== --CLEAN-- --EXPECTF-- string(%d) "%sextfile.php" Warning: file_get_contents(phar://%stempmanifest1.phar.php/testit/directory): failed to open stream: phar error: path "testit/directory" is a directory in phar://%stempmanifest1.phar.php/index.php on line %d oops string(%d) "phar://%sextfile.php" string(%d) "phar://%sextfile2.php" Mounting of .phar/stub.php to %sextfile.php within phar %stests/tempmanifest1.phar.php failed . .. directory extfile.php extfile2.php phar://%stempmanifest1.phar.php/testit%cdirectory phar://%stempmanifest1.phar.php/testit%cextfile.php phar://%stempmanifest1.phar.php/testit%cextfile2.php Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed ===DONE===