Brian Moon wrote:
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.

calm down :S
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.

Yea I do like that idea, didn't think of that approach.
As for inconsistent behaviour.. It's not a huge deal, and the situation can easily described in the documentation. But yea, this is also why I proposed an ini setting.

Rasmus' solution solves my problem though. Thanks a lot!

Evert

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

Reply via email to