[PHP4BETA] SAPI status
| From: | Zeev Suraski | Date: | Wed, 05 May 1999 22:11:52 +0000 |
| Subject: | [PHP4BETA] SAPI status | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-658@lists.php.net to get a copy of this message | ||
Today we've added a framework for headers in SAPI. So far we've only implemented the framework callbacks for ISAPI, and had a very reassuring success running PHP 4.0 as an IIS module, even when bombarding the server with requests, with no crashes at all (ran inetinfo.exe through a debugger).
If you take a look at head.c, two very short functions replace the huge #directive infested chunks of code for php3_header() and php4i_add_header(). When we're done implementing the framework callbacks for Apache and CGI (hopefully sometime soon) - we can get rid of the old implementations completely.
The headers support is designed to make most of the work for you, while giving you the ability to override it, fully or partially, as necessary. In most server APIs, you would only have to supply a function that sends a header line. In somewhat weirder server APIs, such as ISAPI (which expects all of its headers to be sent as one long concatenated string), you can override the header sending behavior completely, and do it yourself.
Rasmus, I've taken a look at the way cookies are supported, and I simply can't understand why there's a special rule for cookies, i.e., why aren't they handled just like any other header, and instead stored in a stack. We haven't put in any special cookie support, since to the best of my knowledge, setting a cookie is nothing but sending a Set-Cookie: header. Am I wrong?
Zeev
--
Zeev Suraski <zeev@zend.com> http://www.zend.com/
For a PGP public key, finger bourbon@netvision.net.il
--
PHP 4 Beta