# update on phar extension work

- Thread: https://externals.io/message/35312
- Original archive: https://news-web.php.net/php.internals/35312
- Started by Gregory Beaver on 2008-02-07T23:48:47+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #35312 — Gregory Beaver — 2008-02-07T23:48:47+00:00

URL: https://externals.io/message/35312#35312

Hi,

A short update on improvements to phar

 * Phar::webPhar() now works with CGI sapi (endless redirect happened
before)
 * Phar::webPhar() now recognizes urls exactly the same way as apache,
so http://localhost/myphar.phar/file.php/extra/stuff will find
"file.php" hidden in the url and retrieve it.
 * Phar::mungServer() was incorrectly making SCRIPT_NAME the same as
SCRIPT_FILENAME, now it is the value expected.
 * Phar::webPhar()'s $rewrite parameter is documented as an array of
path names to actual location.  This is too inflexible, and has instead
been replaced with a simple callback.  A php function that takes a
string as an argument and returns the actual path expected is used.  In
addition, if the function returns false, webPhar() will throw an HTTP
403 Denied code, so sections of a phar archive can be marked as off
limits.  This solves a problem of not having a protected out of document
root webspace inside a phar archive.

There are some memory leaks to clean up, and a few other problems, but
we're making progress.  I have a backlog of a few apps sent offline that
don't quite work that I need to debug to determine what is causing the
breakage, more on that later.

Greg
