Convert usage of php_error/zend_error to php_error_docref - #22927
Convert usage of php_error/zend_error to php_error_docref#22927NattyNarwhal wants to merge 13 commits into
php_error/zend_error to php_error_docref#22927Conversation
a3f4107 to
a908d3a
Compare
Girgias
left a comment
There was a problem hiding this comment.
I think the exif, sodium, pdo, pdo_sqlite, net_get_interface, ini_parse_quantity, auto_detect_line_ending, and math can all land.
There was a problem hiding this comment.
The faultstring here should be updated.
| ?> | ||
| --EXPECTF-- | ||
| Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '%sbug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d | ||
| Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d |
There was a problem hiding this comment.
Your local path is leaking in this test.
| #define soap_error0(severity, format) \ | ||
| php_error(severity, "SOAP-ERROR: " format) | ||
|
|
||
| #define soap_error1(severity, format, param1) \ | ||
| php_error(severity, "SOAP-ERROR: " format, param1) | ||
|
|
||
| #define soap_error2(severity, format, param1, param2) \ | ||
| php_error(severity, "SOAP-ERROR: " format, param1, param2) | ||
|
|
||
| #define soap_error3(severity, format, param1, param2, param3) \ | ||
| php_error(severity, "SOAP-ERROR: " format, param1, param2, param3) |
There was a problem hiding this comment.
Might make sense to first have a PR that converts those macro variants to a single one, and then do the docref conversion in a follow-up.
There was a problem hiding this comment.
I'll try to break this up better in a separate PR, since the history of this one is a little weird anyways
| zend_string_equals_ci(ctx->current_section_name, Z_STR_P(arg2)) | ||
| ) { | ||
| zend_error(E_CORE_ERROR, "Invalid browscap ini file: " | ||
| php_error_docref(NULL, E_CORE_ERROR, "Invalid browscap ini file: " |
There was a problem hiding this comment.
Not exactly sure how the docref should be written but I thinki: "misc.configuration.php#ini.browscap" might work?
There is some more usage with i.e. soap_error0, which is a little crude.
With docref, even without args, the function that sourced the error will alwsays be prefixed.
a908d3a to
6a518e4
Compare
Not yet complete, likely adding more. Some notes so far:
php_erroras an alias forzend_error, make error reporting more consistent, and eventually figure out some symmetry betweenphp_verrorandphp_error_docrefnaming wise.zend_errorshould remain, but there may be quite a bit of overlap anyways.extsince this usually is for functions where thephp_error_docrefoutput makes sense when prefixing with a function name and optionally arguments (or indicating phase of startup/shutdown). There are some notable exceptions (some stuff related to arrays and comparisons) that do not work in that context.Zendandsapitoo.ext/soapare a bit wider, getting rid of some pointless macros and replacing theSOAP-ERRORprefix with the function prefix from docref output. This could be broken out into a separate PR.#if DEBUGtype code. Worth changing?