Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Zend/zend.c
- ===================================================================
- --- Zend/zend.c (revision 290872)
- +++ Zend/zend.c (working copy)
- @@ -1010,7 +1010,8 @@
- if (!error_filename) {
- error_filename = "Unknown";
- }
- -
- +
- + EG(error_handled_by_user) = 0;
- va_start(args, format);
- /* if we don't have a user defined error handler */
- @@ -1104,6 +1105,20 @@
- zend_error_cb(type, error_filename, error_lineno, format, args);
- }
- zval_ptr_dtor(&retval);
- +
- + /* allows monitoring type extensions to intercept calls even if
- + user has defined an error handler. */
- + if (EG(always_invoke_error_cb)) {
- + va_list orig_cb_copy;
- +
- + va_copy(orig_cb_copy, args);
- + EG(error_handled_by_user) = 1;
- + zend_error_cb(type, error_filename, error_lineno, format, orig_cb_copy);
- +#ifdef va_copy
- + va_end(orig_cb_copy);
- +#endif
- + EG(error_handled_by_user) = 0;
- + }
- }
- } else if (!EG(exception)) {
- /* The user error handler failed, use built-in error handler */
- Index: Zend/zend_globals.h
- ===================================================================
- --- Zend/zend_globals.h (revision 290872)
- +++ Zend/zend_globals.h (working copy)
- @@ -257,6 +257,9 @@
- void *saved_fpu_cw;
- void *reserved[ZEND_MAX_RESERVED_RESOURCES];
- +
- + zend_bool always_invoke_error_cb;
- + zend_bool error_handled_by_user;
- };
- struct _zend_ini_scanner_globals {
- Index: Zend/zend_execute_API.c
- ===================================================================
- --- Zend/zend_execute_API.c (revision 290872)
- +++ Zend/zend_execute_API.c (working copy)
- @@ -150,6 +150,8 @@
- EG(in_autoload) = NULL;
- EG(autoload_func) = NULL;
- EG(error_handling) = EH_NORMAL;
- + EG(always_invoke_error_cb) = 0;
- + EG(error_handled_by_user) = 0;
- zend_vm_stack_init(TSRMLS_C);
- zend_vm_stack_push((void *) NULL TSRMLS_CC);
Add Comment
Please, Sign In to add comment