Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-27 Thread George Schlossnagle

A little update on all of this.

I changed the way that the handlers are created in the apache config from

php_value uri_handler /tmp/foo.php
to
phpUriHandler /tmp/foo.php

and logically separated them from the ini structure.  This eliminates 
some unnecessary work that was being done before and allows for stacked 
handlers more easily.  I have the stacked handler code all working 
correctly, but I'm waiting on approval/disapproval of my zend_stack 
patch I posted earlier before I commit (my changes assume that patch at 
the moment).  A couple new things are supported as well

phpRequire /tmp/bar.php

which effectively 'require's a file before any work is done in a request 
(since scope is shared throughout all stages of the request this is 
available everywhere). And

phpResponseHandler /tmp/foofoo.php

Which is a very experimental AddHandler response-time handler (similair 
to perl PerlHandler)

Both of these are stackable, so you can do

phpRequire /tmp/bar.php
phpRequire /tmp/bar2.php

in the same section and have them both run (same for all the handlers).

I will wait a while to see if the zend_stack changes are accepted, if 
not I will just implement my own stack locally and use that instead.

George



Edin Kadribasic wrote:

>>Ok, this has all been added to the apache_hooks branch, which is now
>>up-to-date.
>>
>
>Very nice. IMHO this should be merged into HEAD as soon as PHP_4_3_0 is
>branched off.
>
>Edin
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Edin Kadribasic

> Ok, this has all been added to the apache_hooks branch, which is now
> up-to-date.

Very nice. IMHO this should be merged into HEAD as soon as PHP_4_3_0 is
branched off.

Edin


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

Ok, this has all been added to the apache_hooks branch, which is now 
up-to-date.

George Schlossnagle wrote:

> If you want to pull everything into the apche_hooks branch, I can do 
> that as well.  But if we do that, it would probably wise to update 
> everything in that branch to HEAD.
>
>
> George Schlossnagle wrote:
>
>> I haven't committed anything yet.  It seems like the benefit of 
>> starting with a fresh copy of HEAD is taht, well, it's a fresh copy 
>> of HEAD. Since there is nothing used from the old apache_hooks branch 
>> it makes sense to me to start afresh.  new name/old name makes no 
>> difference to me.
>>
>> Lukas Schroeder wrote:
>>
>>> On Mon, Aug 26, 2002 at 02:59:01PM -0400, George Schlossnagle wrote:
>>>
 I actually just made a 'new_apache_hooks' branch and am about to 
 commit it all there

>>>
>>> argh. so, what now?
>>> i don't like having two branches for this.
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

If you want to pull everything into the apche_hooks branch, I can do 
that as well.  But if we do that, it would probably wise to update 
everything in that branch to HEAD.


George Schlossnagle wrote:

> I haven't committed anything yet.  It seems like the benefit of 
> starting with a fresh copy of HEAD is taht, well, it's a fresh copy of 
> HEAD. Since there is nothing used from the old apache_hooks branch it 
> makes sense to me to start afresh.  new name/old name makes no 
> difference to me.
>
> Lukas Schroeder wrote:
>
>> On Mon, Aug 26, 2002 at 02:59:01PM -0400, George Schlossnagle wrote:
>>
>>> I actually just made a 'new_apache_hooks' branch and am about to 
>>> commit it all there
>>>
>>
>> argh. so, what now?
>> i don't like having two branches for this.
>>
>>
>>
>>
>
>
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

I haven't committed anything yet.  It seems like the benefit of starting 
with a fresh copy of HEAD is taht, well, it's a fresh copy of HEAD. 
 Since there is nothing used from the old apache_hooks branch it makes 
sense to me to start afresh.  new name/old name makes no difference to me.

Lukas Schroeder wrote:

>On Mon, Aug 26, 2002 at 02:59:01PM -0400, George Schlossnagle wrote:
>
>>I actually just made a 'new_apache_hooks' branch and am about to commit 
>>it all there
>>
>
>argh. so, what now?
>i don't like having two branches for this.
>
>
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Lukas Schroeder

On Mon, Aug 26, 2002 at 02:59:01PM -0400, George Schlossnagle wrote:
> I actually just made a 'new_apache_hooks' branch and am about to commit 
> it all there

argh. so, what now?
i don't like having two branches for this.




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

Lukas Schroeder wrote:

>On Mon, Aug 26, 2002 at 11:18:38AM -0700, Rasmus Lerdorf wrote:
>
>>>Well, after 4.3.0 is branched I guess the next release would be
>>>PHP 5 so it's not that far away. If only Stig would start with the
>>>branch :) Anyway, I'm more in favor of having this nice hook stuff
>>>in a seperate branch than with 'magic' things like setting defines.
>>>
>>We can do that, it's just more work to keep it current and as we all know,
>>merging branches in CVS just is not a good thing to do.
>>
>
>i offer to do the ugly work.
>i put it into the branch for now, so i dont even have to think i tiny
>bit about breaking anything. and if time comes, i'll prepare the
>necessary patch sets to merge into the php5 branch, without having to
>use the dreaded cvs merge branch 'feature'.
>
>would that be a deal?
>if so, i'll commit it to apache_hooks today...
>

I actually just made a 'new_apache_hooks' branch and am about to commit 
it all there




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

> i offer to do the ugly work.
> i put it into the branch for now, so i dont even have to think i tiny
> bit about breaking anything. and if time comes, i'll prepare the
> necessary patch sets to merge into the php5 branch, without having to
> use the dreaded cvs merge branch 'feature'.
>
> would that be a deal?
> if so, i'll commit it to apache_hooks today...

Go for it.  Having it in a branch is the safest approach.

-Rasmus


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Lukas Schroeder


On Mon, Aug 26, 2002 at 11:18:38AM -0700, Rasmus Lerdorf wrote:
> > Well, after 4.3.0 is branched I guess the next release would be
> > PHP 5 so it's not that far away. If only Stig would start with the
> > branch :) Anyway, I'm more in favor of having this nice hook stuff
> > in a seperate branch than with 'magic' things like setting defines.
> 
> We can do that, it's just more work to keep it current and as we all know,
> merging branches in CVS just is not a good thing to do.

i offer to do the ugly work.
i put it into the branch for now, so i dont even have to think i tiny
bit about breaking anything. and if time comes, i'll prepare the
necessary patch sets to merge into the php5 branch, without having to
use the dreaded cvs merge branch 'feature'.

would that be a deal?
if so, i'll commit it to apache_hooks today...


regards,
  -lukas



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

> On Mon, 26 Aug 2002, Rasmus Lerdorf wrote:
>
> > Yeah, but the point, at least for now is that the code really isn't meant
> > to even be used by QA folks yet.  It is work targeted for PHP 5.
>
> hmm... starting with a PHP5 branch would be a little early now don't you
> think?

Yup - hence the confusion on where to stick this stuff.

> Well, after 4.3.0 is branched I guess the next release would be
> PHP 5 so it's not that far away. If only Stig would start with the
> branch :) Anyway, I'm more in favor of having this nice hook stuff
> in a seperate branch than with 'magic' things like setting defines.

We can do that, it's just more work to keep it current and as we all know,
merging branches in CVS just is not a good thing to do.

-Rasmus


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread derick

On Mon, 26 Aug 2002, Rasmus Lerdorf wrote:

> Yeah, but the point, at least for now is that the code really isn't meant
> to even be used by QA folks yet.  It is work targeted for PHP 5.

hmm... starting with a PHP5 branch would be a little early now don't you 
think? Well, after 4.3.0 is branched I guess the next release would be 
PHP 5 so it's not that far away. If only Stig would start with the 
branch :) Anyway, I'm more in favor of having this nice hook stuff 
in a seperate branch than with 'magic' things like setting defines.

Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

> On Mon, 26 Aug 2002, Rasmus Lerdorf wrote:
>
> > Well, the problem with doing it on a branch, the way I did, and as Lukas
> > found out, is that it goes rather stale after a while.  So I guess that I
> > am actually proposing putting it in HEAD but #ifdef'ed out and perhaps not
> > even providing a user-visible config option for it yet.  You'd need to set
> > a CFLAGS -DHOOKS=1 to activate it for now.
>
> hmm, i'd rather see a configure option for it as this will make it
> easier to compile in (for QA ppl). I do just not favor 'magic' flags to
> enable things.

Yeah, but the point, at least for now is that the code really isn't meant
to even be used by QA folks yet.  It is work targeted for PHP 5.

-Rasmus


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread derick

On Mon, 26 Aug 2002, Rasmus Lerdorf wrote:

> Well, the problem with doing it on a branch, the way I did, and as Lukas
> found out, is that it goes rather stale after a while.  So I guess that I
> am actually proposing putting it in HEAD but #ifdef'ed out and perhaps not
> even providing a user-visible config option for it yet.  You'd need to set
> a CFLAGS -DHOOKS=1 to activate it for now.

hmm, i'd rather see a configure option for it as this will make it 
easier to compile in (for QA ppl). I do just not favor 'magic' flags to 
enable things.

Derick



> 
> -Rasmus
> 
> On Mon, 26 Aug 2002, George Schlossnagle wrote:
> 
> > I wasn't proposing putting it in HEAD, just that the work was done
> > against HEAD not against your apache_hooks.  Lukas redid all the
> > php<->apache request object work fresh off of head, and I made changes
> > off of that, so it contains nothing from your apache_hooks branch.
> >
> > Rasmus Lerdorf wrote:
> >
> > >I think if we put this in 4.3 we are going to delay 4.3 even further.
> > >Although, I suppose if we are careful and make sure we #ifdef it nicely
> > >and only turn it on with a configure option, we can put it in HEAD.
> > >
> > >So, is your patch my apache_hooks stuff + Lukas's work and then your stuff
> > >on top?
> > >
> > >On Mon, 26 Aug 2002, George Schlossnagle wrote:
> > >
> > >>All of this work was off HEAD.  Should a  new_apache_hooks branch be tagged?
> > >>
> > >>Rasmus Lerdorf wrote:
> > >>
> > >>>I say commit it.  This stuff is very experimental as it is and lives in
> > >>>its own branch.  You are not going to destabilize anything.
> > >>>
> > >>>(I just made sure you had enough karma for the commit)
> > >>>
> > >>>-Rasmus
> > >>>
> > >>
> > >
> > >
> >
> >
> >
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

Well, the problem with doing it on a branch, the way I did, and as Lukas
found out, is that it goes rather stale after a while.  So I guess that I
am actually proposing putting it in HEAD but #ifdef'ed out and perhaps not
even providing a user-visible config option for it yet.  You'd need to set
a CFLAGS -DHOOKS=1 to activate it for now.

-Rasmus

On Mon, 26 Aug 2002, George Schlossnagle wrote:

> I wasn't proposing putting it in HEAD, just that the work was done
> against HEAD not against your apache_hooks.  Lukas redid all the
> php<->apache request object work fresh off of head, and I made changes
> off of that, so it contains nothing from your apache_hooks branch.
>
> Rasmus Lerdorf wrote:
>
> >I think if we put this in 4.3 we are going to delay 4.3 even further.
> >Although, I suppose if we are careful and make sure we #ifdef it nicely
> >and only turn it on with a configure option, we can put it in HEAD.
> >
> >So, is your patch my apache_hooks stuff + Lukas's work and then your stuff
> >on top?
> >
> >On Mon, 26 Aug 2002, George Schlossnagle wrote:
> >
> >>All of this work was off HEAD.  Should a  new_apache_hooks branch be tagged?
> >>
> >>Rasmus Lerdorf wrote:
> >>
> >>>I say commit it.  This stuff is very experimental as it is and lives in
> >>>its own branch.  You are not going to destabilize anything.
> >>>
> >>>(I just made sure you had enough karma for the commit)
> >>>
> >>>-Rasmus
> >>>
> >>
> >
> >
>
>
>


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

I wasn't proposing putting it in HEAD, just that the work was done 
against HEAD not against your apache_hooks.  Lukas redid all the 
php<->apache request object work fresh off of head, and I made changes 
off of that, so it contains nothing from your apache_hooks branch.

Rasmus Lerdorf wrote:

>I think if we put this in 4.3 we are going to delay 4.3 even further.
>Although, I suppose if we are careful and make sure we #ifdef it nicely
>and only turn it on with a configure option, we can put it in HEAD.
>
>So, is your patch my apache_hooks stuff + Lukas's work and then your stuff
>on top?
>
>On Mon, 26 Aug 2002, George Schlossnagle wrote:
>
>>All of this work was off HEAD.  Should a  new_apache_hooks branch be tagged?
>>
>>Rasmus Lerdorf wrote:
>>
>>>I say commit it.  This stuff is very experimental as it is and lives in
>>>its own branch.  You are not going to destabilize anything.
>>>
>>>(I just made sure you had enough karma for the commit)
>>>
>>>-Rasmus
>>>
>>
>
>




-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

I think if we put this in 4.3 we are going to delay 4.3 even further.
Although, I suppose if we are careful and make sure we #ifdef it nicely
and only turn it on with a configure option, we can put it in HEAD.

So, is your patch my apache_hooks stuff + Lukas's work and then your stuff
on top?

On Mon, 26 Aug 2002, George Schlossnagle wrote:

> All of this work was off HEAD.  Should a  new_apache_hooks branch be tagged?
>
> Rasmus Lerdorf wrote:
>
> >I say commit it.  This stuff is very experimental as it is and lives in
> >its own branch.  You are not going to destabilize anything.
> >
> >(I just made sure you had enough karma for the commit)
> >
> >-Rasmus
> >
>
>


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

All of this work was off HEAD.  Should a  new_apache_hooks branch be tagged?

Rasmus Lerdorf wrote:

>I say commit it.  This stuff is very experimental as it is and lives in
>its own branch.  You are not going to destabilize anything.
>
>(I just made sure you had enough karma for the commit)
>
>-Rasmus
>



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread Rasmus Lerdorf

I say commit it.  This stuff is very experimental as it is and lives in
its own branch.  You are not going to destabilize anything.

(I just made sure you had enough karma for the commit)

-Rasmus

On Mon, 26 Aug 2002, George Schlossnagle wrote:

> Here's an incremental patch on Lukas' patch which tries to address a
> couple issues:
>
> o  The startup sequence has been changed to allow for post-data to make
> it through if any hooks before full post-data is read are called
> o  works under register_globals Off ($request is now available in the
> SERVER var hash when register globals is enabled)
> o  all hooks and the 'main' content handler all share a common scope
> (there is only one call to zend_startup, and only one shutdown).  This
> is significantly cheaper plus it allows for handy stuff like creating
> data structures in a hook and magicall passing them to other hooks or
> into the main script.  This is experimental and may break some of the
> other sapi modules as-is (though that clearly wasn't the intention ;)
>
> George
>
>
> Lukas Schroeder wrote:
>
> >hi,
> >
> >here's another shot of the current apache_hooks code.
> >
> >there are some issues with startup and cleanup currently.
> >and the patch messes a bit with php's startup procedure.
> >
> >still missing is access to array_header (think headers_in, headers_out,
> >headers_err) and table slot in request_rec, as is access to the
> >whole connection structure of the request.
> >
> >but the string and int fields can be read and where appropriate written
> >to. and there are some methods that wrap the ap_ family.
> >
> >
> >
> >regards,
> >  -lukas
> >
>
>
>


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: [rfc] apache_hooks update (yet incomplete)

2002-08-26 Thread George Schlossnagle

Here's an incremental patch on Lukas' patch which tries to address a 
couple issues:

o  The startup sequence has been changed to allow for post-data to make 
it through if any hooks before full post-data is read are called
o  works under register_globals Off ($request is now available in the 
SERVER var hash when register globals is enabled)
o  all hooks and the 'main' content handler all share a common scope 
(there is only one call to zend_startup, and only one shutdown).  This 
is significantly cheaper plus it allows for handy stuff like creating 
data structures in a hook and magicall passing them to other hooks or 
into the main script.  This is experimental and may break some of the 
other sapi modules as-is (though that clearly wasn't the intention ;)

George


Lukas Schroeder wrote:

>hi,
>
>here's another shot of the current apache_hooks code.
>
>there are some issues with startup and cleanup currently.
>and the patch messes a bit with php's startup procedure.
>
>still missing is access to array_header (think headers_in, headers_out,
>headers_err) and table slot in request_rec, as is access to the
>whole connection structure of the request.
>
>but the string and int fields can be read and where appropriate written
>to. and there are some methods that wrap the ap_ family.
>
>
>
>regards,
>  -lukas
>




diff -u3 -r php4-lucas3/main/SAPI.c php4-george/main/SAPI.c
--- php4-lucas3/main/SAPI.c Mon Aug 26 11:44:12 2002
+++ php4-george/main/SAPI.c Mon Aug 26 12:05:51 2002
@@ -382,6 +382,7 @@
SG(sapi_headers).mimetype = NULL;
}
sapi_send_headers_free(TSRMLS_C);
+SG(sapi_started) = 0;
 }
 
 
diff -u3 -r php4-lucas3/main/SAPI.h php4-george/main/SAPI.h
--- php4-lucas3/main/SAPI.h Mon Aug 26 11:44:12 2002
+++ php4-george/main/SAPI.h Mon Aug 26 12:04:04 2002
@@ -117,6 +117,7 @@
HashTable *rfc1867_uploaded_files;
long post_max_size;
 int options;
+zend_bool sapi_started;
 } sapi_globals_struct;
 
 
diff -u3 -r php4-lucas3/main/main.c php4-george/main/main.c
--- php4-lucas3/main/main.c Mon Aug 26 11:45:03 2002
+++ php4-george/main/main.c Mon Aug 26 12:42:10 2002
@@ -816,54 +816,52 @@
 /* {{{ php_request_startup
  */
 int php_request_startup(TSRMLS_D)
-{
-   int retval = SUCCESS;
-
+{   
+int retval = SUCCESS;
 #if PHP_SIGCHILD
-   signal(SIGCHLD, sigchld_handler);
-#endif
-
-   zend_try {
-   PG(during_request_startup) = 1;
-   
-   php_output_activate(TSRMLS_C);
-
-   /* initialize global variables */
-   PG(modules_activated) = 0;
-   PG(header_is_being_sent) = 0;
-   PG(connection_status) = PHP_CONNECTION_NORMAL;
-   
-   zend_activate(TSRMLS_C);
-   sapi_activate(TSRMLS_C);
-
-   zend_set_timeout(EG(timeout_seconds));
-
-   if (PG(expose_php)) {
-   sapi_add_header(SAPI_PHP_VERSION_HEADER, 
sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
-   }
-
-   if (PG(output_handler) && PG(output_handler)[0]) {
-   php_start_ob_buffer_named(PG(output_handler), 0, 1 TSRMLS_CC);
-   }
-   else if (PG(output_buffering)) {
-   php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
-   }
-   else if (PG(implicit_flush)) {
-   php_start_implicit_flush(TSRMLS_C);
-   }
-
-   /* We turn this off in php_execute_script() */
-   /* PG(during_request_startup) = 0; */
-
-   php_hash_environment(TSRMLS_C);
-   zend_activate_modules(TSRMLS_C);
-   PG(modules_activated)=1;
-   } zend_catch {
-   retval = FAILURE;
-   } zend_end_try();
+signal(SIGCHLD, sigchld_handler);
+#endif  
+if(!SG(sapi_started)) {
+zend_try {
+PG(during_request_startup) = 1;
+
+/* initialize global variables */
+PG(modules_activated) = 0;
+PG(header_is_being_sent) = 0;
+PG(connection_status) = PHP_CONNECTION_NORMAL;
+
+zend_activate(TSRMLS_C);
+zend_set_timeout(EG(timeout_seconds));
+zend_activate_modules(TSRMLS_C);
+PG(modules_activated)=1;
+} zend_catch {
+retval = FAILURE;
+} zend_end_try();
+SG(sapi_started) = 1;
+}   
+php_output_activate(TSRMLS_C);
+sapi_activate(TSRMLS_C);
+php_hash_environment(TSRMLS_C);
+zend_try {
+if (PG(expose_php)) {
+sapi_add_header(SAPI_PHP_VERSION_HEADER, 
+sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
+}
+if (PG(output_handler) && PG(output_handler)[0]) {
+php_start_ob_buffer_named(PG(output_handler), 0, 1 TSRMLS_CC);
+}
+else if (PG(output_buffering)) {
+php_start_ob_buffer