mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
02c7ff1343
Phar->webPhar(): <?php Phar::webPhar(); __HALT_COMPILER(); With the above stub, the default front controller will kick in. An array of mime type overrides, and another array mapping phar file entry -> redirected entry can be used to further customize [DOC]
33 lines
742 B
PHP
33 lines
742 B
PHP
--TEST--
|
|
Phar front controller php
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("phar")) print "skip"; ?>
|
|
--INI--
|
|
phar.require_hash=0
|
|
phar.readonly=0
|
|
--FILE--
|
|
<?php
|
|
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
|
|
$pname = 'phar://' . $fname;
|
|
|
|
$a = new Phar($fname);
|
|
$a['a.php'] = 'hio';
|
|
$a->setStub('<?php
|
|
Phar::webPhar();
|
|
__HALT_COMPILER();');
|
|
|
|
$_SERVER['REQUEST_URI'] = '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
|
|
include $fname;
|
|
?>
|
|
===DONE===
|
|
--CLEAN--
|
|
<?php
|
|
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
|
|
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phartmp.php');
|
|
__HALT_COMPILER();
|
|
?>
|
|
--EXPECTHEADERS--
|
|
Content-type: text/html
|
|
--EXPECT--
|
|
hio
|