diff --git a/ChangeLog b/ChangeLog index 2c6845c..a9ac6b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ Ini Settings Changes ChangeLog ======== - * compiler errors: all compiler warning (e.g.: E_STRICT) is now cached and is supported for user handler + * compiler errors: all compiler warning (E_STRICT only currently) is now cached and is supported for user handler * added module dependency * live with wrong system time: allow caching files with mtime in further * bug fix for compatibility with Zend Optimizer and other non-cachable diff --git a/processor/processor.m4 b/processor/processor.m4 index 1d112cd..035539e 100644 --- a/processor/processor.m4 +++ b/processor/processor.m4 @@ -745,7 +745,6 @@ dnl }}} #endif #ifdef E_STRICT DEF_STRUCT_P_FUNC(`xc_compilererror_t', , `dnl {{{ - DISPATCH(int, type) DISPATCH(uint, lineno) DISPATCH(int, error_len) PROC_STRING_L(error, error_len) diff --git a/utils.c b/utils.c index b3cc31b..e6a70f8 100644 --- a/utils.c +++ b/utils.c @@ -525,6 +525,24 @@ static void xc_sandbox_error_cb(int type, const char *error_filename, const uint sandbox = (xc_sandbox_t *) XG(sandbox); assert(sandbox != NULL); + if (type != E_STRICT) { + /* give up, and user handler is not supported in this case */ + int i; + zend_uint orig_lineno = CG(zend_lineno); + zend_error_cb = sandbox->orig_zend_error_cb; + + for (i = 0; i < sandbox->compilererror_cnt; i ++) { + compilererror = &sandbox->compilererrors[i]; + CG(zend_lineno) = compilererror->lineno; + zend_error(E_STRICT, "%s", compilererror->error); + } + CG(zend_lineno) = orig_lineno; + sandbox->compilererror_cnt = 0; + + sandbox->orig_zend_error_cb(type, error_filename, error_lineno, format, args); + return; + } + if (sandbox->compilererror_cnt <= sandbox->compilererror_size) { if (sandbox->compilererror_size) { sandbox->compilererror_size += 16; @@ -536,7 +554,6 @@ static void xc_sandbox_error_cb(int type, const char *error_filename, const uint } } compilererror = &sandbox->compilererrors[sandbox->compilererror_cnt++]; - compilererror->type = type; compilererror->lineno = error_lineno; compilererror->error_len = zend_vspprintf(&compilererror->error, 0, format, args); } @@ -720,7 +737,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t instal for (i = 0; i < sandbox->compilererror_cnt; i ++) { xc_compilererror_t *error = &sandbox->compilererrors[i]; CG(zend_lineno) = error->lineno; - zend_error(error->type, "%s", error->error); + zend_error(E_STRICT, "%s", error->error); } CG(zend_lineno) = 0; #endif diff --git a/xcache.c b/xcache.c index 7f3ab9a..e901ec9 100644 --- a/xcache.c +++ b/xcache.c @@ -669,7 +669,7 @@ static zend_op_array *xc_entry_install(xc_entry_t *xce, zend_file_handle *h TSRM for (i = 0; i < p->compilererror_cnt; i ++) { xc_compilererror_t *error = &p->compilererrors[i]; CG(zend_lineno) = error->lineno; - zend_error(error->type, "%s", error->error); + zend_error(E_STRICT, "%s", error->error); } CG(zend_lineno) = 0; #endif diff --git a/xcache.h b/xcache.h index 9e2d5ff..1d4f3a3 100644 --- a/xcache.h +++ b/xcache.h @@ -267,7 +267,6 @@ typedef enum { XC_TYPE_PHP, XC_TYPE_VAR } xc_entry_type_t; typedef char xc_md5sum_t[16]; /* {{{ xc_compilererror_t */ typedef struct { - int type; uint lineno; int error_len; char *error;