php-src/ext/phar/tests/017.phpt
Greg Beaver 37c684ab3d in preparation for a performance optimization that involves
eliminating phar's interception of zend_compile in favor of a new to-be-added hook in PHP 5.3+,
allow "include 'phar:///path/to/my.phar';" to work as equivalent to
php /path/to/my.phar
this slight change in scripting still allows inclusion and execution of phar stub, but removes the need to
check and modify path in zend_compile, which allows us to play much nicer with external tools like
debuggers/opcode caches
2008-06-27 01:21:12 +00:00

31 lines
901 B
PHP

--TEST--
Phar: opendir test - no dir specified at all
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php
Phar::mapPhar('hio');
var_dump(__FILE__);
var_dump(substr(__FILE__, 0, 4) != 'phar');
__HALT_COMPILER(); ?>";
$files = array();
$files['a'] = 'abc';
include 'files/phar_test.inc';
include $pname;
$dir = opendir('phar://hio');
?>
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
string(%d) "%s017.phar.php"
bool(true)
Warning: opendir(phar://hio): failed to open dir: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory (always use full path to a new phar)
phar url "phar://hio" is unknown in %s017.php on line %d