[Solar-talk] Solar_Http_Response and check-headers-sent

Paul M Jones pmjones at ciaweb.net
Fri Jun 1 11:41:39 PDT 2007


On Jun 1, 2007, at 12:08 PM, Antti Holvikari wrote:

> On 6/1/07, Paul M Jones <pmjones at ciaweb.net> wrote:
>>
>> It helps describe the situation, thanks.  :-)
>>
>> So in this particular case, you don't care if the headers don't get
>> set, and you don't want Response to throw an exception because the
>> headers don't matter in this case.
>>
>> Or, is it that you think Response::setHeader() shouldn't care if
>> headers have already been sent?  (I can see a good case for this.)
>> If so, do you think there should be notification from Response at any
>> time, when headers have already been sent?
>
> We know for a fact that headers need to be checked within our normal
> browser responses back to our browser, but when making HTTP requests
> within your apps the headers must *not* be checked because they have
> nothing to do with my apps response headers to the browser (vs. the
> headers of my "home made" HTTP request's response object).
>
> In that example I gave, Response::setHeader() should *not* check for
> headers because the headers *can't* have been sent. But headers back
> to the browser could have been sent already.

Ah yes, I see your point.  It seems from this that the only time  
Response should check if headers have been sent is at  
Response::display() time.  Would that be a good fix here?


--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the solar-talk mailing list