diff options
author | Sterling Hughes <sterling@php.net> | 2001-06-26 22:48:44 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2001-06-26 22:48:44 +0000 |
commit | abd3b1543cec1bbda8692d145f13f74f14fa31bc (patch) | |
tree | bcd5af07bddf83f5c38ea39f6e3f4be0345616ec | |
parent | 5e999930589ca2c45a979d45b093d5a79e6c7ea6 (diff) | |
download | php-git-abd3b1543cec1bbda8692d145f13f74f14fa31bc.tar.gz |
Making logging optional.
-rw-r--r-- | ext/xslt/sablot.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/xslt/sablot.c b/ext/xslt/sablot.c index 64eea900b8..ac9e3f6fc1 100644 --- a/ext/xslt/sablot.c +++ b/ext/xslt/sablot.c @@ -436,8 +436,15 @@ PHP_FUNCTION(xslt_set_log) WRONG_PARAM_COUNT; } 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 (XSLT_LOG(handle).path) { efree(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 */ int error = 0; /* Error container */ + if (!XSLT_LOG(handle).do_log) + return 0; + /* Parse the error array */ /* Loop through the error array */ if (fields) { |