Evert | Rooftop wrote:
> Thats a smart idea.. I like that
>
> As for letting PHP do the 500, I tend to use output buffering everywhere
> (i think most people do, supposed to be faster too) so I'm used to
> setting header()'s wherever I need them..
You think wrong. There are very good reasons not to use output buffering.
> Besides, in most of my script the business logic gets executed first,
> and this is where most errors can happen.. only after the presentation
> is done.
>
> So the solution would be, if fatal error is triggered, and
> headers_sent() is false then set the error to 500..
This produces inconsistent behavior. I would not be in favor of it.
I suggest you do as Rasmus suggested. Use register_shutdown_function()
perhaps to have a function to change the status code before output is
sent in your specific environment.
--
Brian Moon
-------------
http://dealnews.com/
It's good to be cheap =)