rfc:improved_error_callback_mechanism
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:improved_error_callback_mechanism [2015/04/08 00:37] – patrickallaert | rfc:improved_error_callback_mechanism [2015/06/10 15:36] – oliviergarcia | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Improved Error Callback Mechanism ====== | ====== PHP RFC: Improved Error Callback Mechanism ====== | ||
- | * Version: 0.2 | + | * Version: 0.4 |
* Create Date: 2015-03-13 | * Create Date: 2015-03-13 | ||
- | * Modify Date: 2015-04-08 | + | * Modify Date: 2015-06-10 |
* Author: Patrick Allaert < | * Author: Patrick Allaert < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 22: | Line 22: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | We propose to split '' | + | We propose to split '' |
- | - Display the error (**display** | + | - Display the error (**display** |
- | - Log the error (**log** | + | - Log the error (**log** |
- | - Do additional processing if needed (**process** | + | - Do additional processing if needed (**process** |
- | - Check if the error is recoverable and bail out if needed (**bailout** | + | - Check if the error is recoverable and bail out if needed (**bailout** |
- | We believe that there is no interesting use case for hooking the other existing | + | We believe that there is no interesting use case for hooking the other existing |
- | An extension that want to extend one of the part can do it so by **appending** a hook: | + | An extension that want to extend one of the category |
<code c> | <code c> | ||
- | | + | |
/* Do some logging with error line number, filename, message, ... */ | /* Do some logging with error line number, filename, message, ... */ | ||
} | } | ||
Line 39: | Line 39: | ||
</ | </ | ||
- | **Prepending** is also possible in the case one want to execute a hook before the other of the same category: | + | Each hook must return either '' |
+ | |||
+ | **Prepending** is also possible in the case one want to execute a hook before the others | ||
<code c> | <code c> | ||
zend_prepend_error_hook(E_HOOK_LOG, | zend_prepend_error_hook(E_HOOK_LOG, | ||
</ | </ | ||
- | An extension that want to **clear** | + | An extension that want to **clear** |
<code c> | <code c> | ||
zend_clear_error_hook(E_HOOK_DISPLAY); | zend_clear_error_hook(E_HOOK_DISPLAY); | ||
</ | </ | ||
+ | '' | ||
- | '' | + | The modification |
==== Overview of the improved '' | ==== Overview of the improved '' | ||
Line 78: | Line 81: | ||
==== Open discussions point ==== | ==== Open discussions point ==== | ||
- | Should the implementation contain pre and post hooks that would be empty by default? It would enable extensions to do some treatment at the early/ | + | Should the implementation |
===== Backward incompatible changes ===== | ===== Backward incompatible changes ===== | ||
Line 93: | Line 96: | ||
===== Open issues ===== | ===== Open issues ===== | ||
None at the moment. | None at the moment. | ||
- | |||
- | ===== Proposed Voting Choices | ||
- | This RFC does not suggest a language change, so a 50%+1 majority is required for passage. | ||
===== Patches and tests ===== | ===== Patches and tests ===== | ||
- | The patch is under creation | + | The patch has been created |
+ | |||
+ | PR available at: https:// | ||
===== Implementation ===== | ===== Implementation ===== | ||
Line 113: | Line 115: | ||
==== User land changes ==== | ==== User land changes ==== | ||
- | It may be interesting to provide changes in the userland so that a user function can be registered as a part of one of those hooks. However, that would complicate this RFC and we consider this as out of the actual scope while considering it as a future enhancement. | + | It may be interesting to provide changes in the userland so that a user function can be registered as a category |
+ | |||
+ | ===== Proposed Voting Choices ===== | ||
+ | Proposed voting choices are Yes (vote in favor) or No (reject the proposed change) | ||
+ | |||
+ | As this is not a language-changing RFC, a majority of 50%+1 is required to approve this RFC. | ||
+ | |||
+ | ===== Vote ====== | ||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Versions ===== | ===== Versions ===== | ||
Line 119: | Line 132: | ||
* 0.1: Initial RFC (2015-03-13) | * 0.1: Initial RFC (2015-03-13) | ||
* 0.2: Changing API slightly + possibility to prepend hooks as suggested by Derick + fixing E_HOOK_PROCESS hooks placement (2015-04-07) | * 0.2: Changing API slightly + possibility to prepend hooks as suggested by Derick + fixing E_HOOK_PROCESS hooks placement (2015-04-07) | ||
+ | * 0.3: Added hook's SUCCESS/ | ||
+ | * 0.4: Closing vote for version 7.0 ("No go" because of feature freeze) |
rfc/improved_error_callback_mechanism.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1