2008-02-25 04:23:36 +00:00
|
|
|
--TEST--
|
|
|
|
Phar: mounted manifest directory test
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
|
|
|
--INI--
|
|
|
|
phar.readonly=0
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$fname = dirname(__FILE__) . '/tempmanifest1.phar.php';
|
|
|
|
$a = new Phar($fname);
|
|
|
|
$a['index.php'] = '<?php
|
2008-03-23 06:00:31 +00:00
|
|
|
Phar::mount("testit", dirname(Phar::running(0)) . "/testit");
|
2008-02-25 04:23:36 +00:00
|
|
|
include "testit/extfile.php";
|
|
|
|
include "testit/extfile2.php";
|
|
|
|
?>';
|
|
|
|
$a->setStub('<?php
|
2008-03-21 18:50:22 +00:00
|
|
|
set_include_path("phar://" . __FILE__);
|
|
|
|
include "index.php";
|
2008-02-25 04:23:36 +00:00
|
|
|
__HALT_COMPILER();');
|
|
|
|
unset($a);
|
|
|
|
mkdir(dirname(__FILE__) . '/testit');
|
|
|
|
file_put_contents(dirname(__FILE__) . '/testit/extfile.php', '<?php
|
|
|
|
var_dump(__FILE__);
|
|
|
|
?>');
|
|
|
|
file_put_contents(dirname(__FILE__) . '/testit/extfile2.php', '<?php
|
|
|
|
var_dump(__FILE__);
|
|
|
|
?>');
|
|
|
|
include dirname(__FILE__) . '/testit/extfile.php';
|
|
|
|
include $fname;
|
|
|
|
?>
|
|
|
|
===DONE===
|
|
|
|
--CLEAN--
|
|
|
|
<?php
|
|
|
|
@unlink(dirname(__FILE__) . '/tempmanifest1.phar.php');
|
|
|
|
@unlink(dirname(__FILE__) . '/testit/extfile.php');
|
|
|
|
@unlink(dirname(__FILE__) . '/testit/extfile2.php');
|
|
|
|
@rmdir(dirname(__FILE__) . '/testit');
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
string(%d) "%sextfile.php"
|
|
|
|
string(%d) "phar://%sextfile.php"
|
|
|
|
string(%d) "phar://%sextfile2.php"
|
|
|
|
===DONE===
|