note 93922 added to phar.webphar
| From: | MikeO' | Date: | Tue, 06 Oct 2009 23:18:54 +0000 |
| Subject: | note 93922 added to phar.webphar | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161418@lists.php.net to get a copy of this message | ||
It appears that the $rewrites parameter is a callback not an array. The implementation seems to be
more in tune with this note http://www.mail-archive.com/internals@lists.php.net/msg33627.html
, although, I was unable to figure out when or if a parameter gets passed to that function. I
implemented it as follows:
<?php
$phar_name = 'mysite.phar';
function phar_rewrites()
{
$r = $_SERVER['REQUEST_URI'];
if (file_exists("phar://$phar_name$r")) return $r;
else return 'index.php';
}
$phar = new Phar();
/*
* do stuff to set up phar
*/
$phar->webPhar($phar_name, 'index.php', '404.php', $mimes,
'phar_rewrites');
?>
The above implementation will also stop the phar from sending out a 301 redirect to the index file
when you rewrite (in apache) all requests to the phar.
----
Server IP: 64.71.164.2
Probable Submitter: 173.63.106.200
----
Manual Page -- http://www.php.net/manual/en/phar.webphar.php
Edit -- https://master.php.net/note/edit/93922
Del: integrated -- https://master.php.net/note/delete/93922/integrated
Del: useless -- https://master.php.net/note/delete/93922/useless
Del: bad code -- https://master.php.net/note/delete/93922/bad+code
Del: spam -- https://master.php.net/note/delete/93922/spam
Del: non-english -- https://master.php.net/note/delete/93922/non-english
Del: in docs -- https://master.php.net/note/delete/93922/in+docs
Del: other reasons-- https://master.php.net/note/delete/93922
Reject -- https://master.php.net/note/reject/93922
Search -- https://master.php.net/manage/user-notes.php