Re: [PATCH] Redirect on Error
| From: | (Marcus Börger) | Date: | Tue, 26 Nov 2002 09:01:45 +0000 |
| Subject: | Re: [PATCH] Redirect on Error | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91724@lists.php.net to get a copy of this message | ||
At 09:47 26.11.2002, Derick Rethans wrote:
On Tue, 26 Nov 2002, Marcus Börger wrote: For example: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", error) would convert to: php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP-42", error) and in the init code we would register these errors: register_error_message("PHP-42", "Error %d") and now translation tables for these error messages are possible. Bloat alert! Do you have any idea how expensive those hash looks ups are? And I would _never_ want to maintain that for any code I write. And how would you handle clashes in here? It's a bad idea. DerickYou pointed me to my failure here :-) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", error) should convert to php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP-42", "Error %d", error) and now loading any external data is optional and registering error messages is no longer needed. And such conversion can easily be done automagically by a sed script. Some people already accepted bundeled cdb as a good message storage. This would require 2 or 3 file lookups per message. And again you shouldn't have one single error message in setups where time is money. In those scenarios you are expected to have *no* error. marcus