2006-01-12 05:19:46 +08:00
|
|
|
--TEST--
|
|
|
|
Phar::loadPhar ignoring alias
|
|
|
|
--SKIPIF--
|
2008-01-05 00:26:44 +08:00
|
|
|
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
2007-01-09 07:03:41 +08:00
|
|
|
--INI--
|
|
|
|
phar.require_hash=0
|
2006-01-12 05:19:46 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
|
|
|
|
$pname = 'phar://' . $fname;
|
2008-08-01 21:36:19 +08:00
|
|
|
$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
|
2006-01-12 05:19:46 +08:00
|
|
|
|
|
|
|
$files = array();
|
2008-05-16 00:09:21 +08:00
|
|
|
$files['a.php'] = '<?php echo "This is a\n"; include \''.$pname.'/b.php\'; ?>';
|
|
|
|
$files['b.php'] = '<?php echo "This is b\n"; include \''.$pname.'/b/c.php\'; ?>';
|
|
|
|
$files['b/c.php'] = '<?php echo "This is b/c\n"; include \''.$pname.'/b/d.php\'; ?>';
|
|
|
|
$files['b/d.php'] = '<?php echo "This is b/d\n"; include \''.$pname.'/e.php\'; ?>';
|
|
|
|
$files['e.php'] = '<?php echo "This is e\n"; ?>';
|
|
|
|
$files['.phar/test'] = '<?php bad boy ?>';
|
2006-01-12 05:19:46 +08:00
|
|
|
|
2008-02-20 21:11:40 +08:00
|
|
|
include 'files/phar_test.inc';
|
2006-01-12 05:19:46 +08:00
|
|
|
|
|
|
|
Phar::loadPhar($fname);
|
|
|
|
|
|
|
|
require $pname . '/a.php';
|
|
|
|
|
2008-05-16 00:09:21 +08:00
|
|
|
$p = new Phar($fname);
|
|
|
|
var_dump(isset($p['.phar/test']));
|
|
|
|
try {
|
|
|
|
$p['.phar/test'];
|
|
|
|
} catch (Exception $e) {
|
|
|
|
echo $e->getMessage(),"\n";
|
|
|
|
}
|
2006-01-12 05:19:46 +08:00
|
|
|
?>
|
|
|
|
===DONE===
|
|
|
|
--CLEAN--
|
2018-10-14 23:45:48 +08:00
|
|
|
<?php
|
2006-01-12 05:19:46 +08:00
|
|
|
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
|
|
|
|
?>
|
2018-02-19 16:59:41 +08:00
|
|
|
--EXPECT--
|
2006-01-12 05:19:46 +08:00
|
|
|
This is a
|
|
|
|
This is b
|
|
|
|
This is b/c
|
|
|
|
This is b/d
|
|
|
|
This is e
|
2008-05-16 00:09:21 +08:00
|
|
|
bool(false)
|
|
|
|
Cannot directly get any files or directories in magic ".phar" directory
|
2006-01-12 05:19:46 +08:00
|
|
|
===DONE===
|