1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Files
archived-php-src/ext/phar/tests/frontcontroller4.phar.inc
T
Greg Beaver e67c584348 [DOC]
refactor the $rewrites parameter in Phar::webPhar.  Now it is a callback
that accepts the path requested.  This callback should return the actual filename
requested as a string, or false to deny access as HTTP 403.
Also fix incorrect munging of SCRIPT_NAME variable in mungServer
More importantly, Phar::webPhar now finds the filename hidden in:
http://localhost/myphar.phar/internal/file.php/extra/stuff
as 'internal/file.php' in phar 'myphar.phar' with REQUEST_URI '/internal/file.php/extra/stuff'
this will allow pharring up apps that use REQUEST_URI for front controller stuff.
2008-02-07 23:42:03 +00:00

19 lines
474 B
PHP

<?php
@unlink(dirname(__FILE__) . '/frontcontroller4.phar');
$a = new Phar(dirname(__FILE__) . '/frontcontroller4.phar');
$a['a.php'] = 'hio';
$a['a.jpg'] = 'hio';
$a['a.phps'] = '<?php function hio(){}';
$a->setStub('<?php
function s($a)
{
static $b = array("/hi" => false);
if (isset($b[$a])) return $b[$a];
return $a;
}
Phar::webPhar("whatever", "index.php", null, array(), "s");
echo "oops did not run\n";
var_dump($_ENV, $_SERVER);
__HALT_COMPILER();');
?>