mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Making logging optional.
This commit is contained in:
parent
5e99993058
commit
abd3b1543c
1 changed files with 11 additions and 1 deletions
|
@ -436,7 +436,14 @@ PHP_FUNCTION(xslt_set_log)
|
||||||
WRONG_PARAM_COUNT;
|
WRONG_PARAM_COUNT;
|
||||||
}
|
}
|
||||||
ZEND_FETCH_RESOURCE(handle, php_xslt *, processor_p, -1, le_xslt_name, le_xslt);
|
ZEND_FETCH_RESOURCE(handle, php_xslt *, processor_p, -1, le_xslt_name, le_xslt);
|
||||||
convert_to_string_ex(logfile);
|
|
||||||
|
if (Z_TYPE_PP(logfile) == IS_LONG) {
|
||||||
|
XSLT_LOG(handle).do_log = Z_LVAL_PP(logfile);
|
||||||
|
RETURN_NULL();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
convert_to_string_ex(logfile);
|
||||||
|
}
|
||||||
|
|
||||||
/* If the log file already exists, free it */
|
/* If the log file already exists, free it */
|
||||||
if (XSLT_LOG(handle).path) {
|
if (XSLT_LOG(handle).path) {
|
||||||
|
@ -1255,6 +1262,9 @@ static MH_ERROR error_log(void *user_data, SablotHandle proc, MH_ERROR code, MH_
|
||||||
char msgformat[] = "Sablotron Message on line %s, level %s: %s\n"; /* Message format */
|
char msgformat[] = "Sablotron Message on line %s, level %s: %s\n"; /* Message format */
|
||||||
int error = 0; /* Error container */
|
int error = 0; /* Error container */
|
||||||
|
|
||||||
|
if (!XSLT_LOG(handle).do_log)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Parse the error array */
|
/* Parse the error array */
|
||||||
/* Loop through the error array */
|
/* Loop through the error array */
|
||||||
if (fields) {
|
if (fields) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue