Re: Capturing headers with output buffering?
| From: | David Brown | Date: | Sun, 24 Nov 2002 23:06:02 +0000 |
| Subject: | Re: Capturing headers with output buffering? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91505@lists.php.net to get a copy of this message | ||
Hi George:
It's something that's probably better solved in user-space, but I
figured I'd poke around anyway. :)
I'm attempting to write a little prefork HTTP server entirely in PHP.
The script instansiates an 'application class', which is persistent
across requests. Output of the application is captured with an ob_*
callback function, and then stuffed down a socket. I'm hoping for free
in-memory opcode caching and database connection persistence (by virtue
of recycling the same interpreter across multiple requests), and
possibly the elimination of a lot of application-specific startup time.
Of course, this whole thing could very well just be a bad idea. :)
Anyway, headers aren't currently included in the buffered output, which
causes the header() function to print to stdout, effectively doing
nothing. I could just wrap header() with a user-space function, but that
would prevent a lot of scripts from running as-is.
Bad idea? Maybe. There's also the matter of getting it to parse
POST/GET without completely reinventing the wheel...
- Dave
On Sun, Nov 24, 2002 at 05:57:33PM -0500, George Schlossnagle wrote:
| What are you trying to accomplish?
|
|
| On Sunday, November 24, 2002, at 05:40 PM, David Brown wrote:
|
| >Hi:
| >
| >Architecturally speaking, is there any simple way to modify an sapi
| >backend to return HTTP headers through the output buffering mechanism?
| >
| >As far as I can tell, headers are managed seperately by main/output.c,
| >with php_ub_body_write_no_header being substituted in once the HTTP
| >headers are sent.
| >
| >Pointers to anything would be greatly appreciated.
| >
| >TIA,
| >- Dave
| >
| >
| >--
| >PHP Development Mailing List <http://www.php.net/>
| >To unsubscribe, visit: http://www.php.net/unsub.php
| >
|
|