From: Adam Dickmeiss Date: Fri, 30 May 2003 09:48:50 +0000 (+0000) Subject: Prevent yaz from logging unless yaz.log_file is set X-Git-Tag: RELEASE_1_0_2~525 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c7c16509bbc4326ee0f9eccecab5b153094d77c;p=php Prevent yaz from logging unless yaz.log_file is set --- diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c index 51d0175429..88999c9051 100644 --- a/ext/yaz/php_yaz.c +++ b/ext/yaz/php_yaz.c @@ -1492,6 +1492,7 @@ PHP_INI_END() PHP_MINIT_FUNCTION(yaz) { int i; + const char *fname; nmem_init(); #ifdef ZTS yaz_mutex = tsrm_mutex_alloc(); @@ -1501,12 +1502,14 @@ PHP_MINIT_FUNCTION(yaz) REGISTER_INI_ENTRIES(); - if (YAZSG(log_file)) { + fname = YAZSG(log_file); + if (fname && *fname) + { + yaz_log_init_file(fname); yaz_log_init_level(LOG_ALL); - yaz_log_init_file(YAZSG(log_file)); - } else { - yaz_log_init_level(0); } + else + yaz_log_init_level(0); le_link = zend_register_list_destructors_ex (yaz_close_link, 0, "YAZ link", module_number);