]> granicus.if.org Git - php/commitdiff
Prevent yaz from logging unless yaz.log_file is set
authorAdam Dickmeiss <dickmeiss@php.net>
Fri, 30 May 2003 09:48:50 +0000 (09:48 +0000)
committerAdam Dickmeiss <dickmeiss@php.net>
Fri, 30 May 2003 09:48:50 +0000 (09:48 +0000)
ext/yaz/php_yaz.c

index 51d017542946e89f65f84dc81d073e1bd9c36381..88999c90517aa875fb161f9cdf8b678f25bd1c79 100644 (file)
@@ -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);