Download | Plain Text | No Line Numbers
- diff -Naur a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
- --- a/ext/standard/basic_functions_arginfo.h 2022-09-14 11:42:49.000000000 +0200
- +++ b/ext/standard/basic_functions_arginfo.h 2022-09-26 13:36:38.291834511 +0200
- @@ -2407,12 +2407,14 @@
- ZEND_FUNCTION(sha1_file);
- #if defined(HAVE_SYSLOG_H)
- ZEND_FUNCTION(openlog);
- +ZEND_FUNCTION(openlog2);
- #endif
- #if defined(HAVE_SYSLOG_H)
- ZEND_FUNCTION(closelog);
- #endif
- #if defined(HAVE_SYSLOG_H)
- ZEND_FUNCTION(syslog);
- +ZEND_FUNCTION(syslog2);
- #endif
- #if defined(HAVE_INET_NTOP)
- ZEND_FUNCTION(inet_ntop);
- @@ -3039,12 +3041,14 @@
- ZEND_FE(sha1_file, arginfo_sha1_file)
- #if defined(HAVE_SYSLOG_H)
- ZEND_FE(openlog, arginfo_openlog)
- + ZEND_FE(openlog2, arginfo_openlog)
- #endif
- #if defined(HAVE_SYSLOG_H)
- ZEND_FE(closelog, arginfo_closelog)
- #endif
- #if defined(HAVE_SYSLOG_H)
- ZEND_FE(syslog, arginfo_syslog)
- + ZEND_FE(syslog2, arginfo_syslog)
- #endif
- #if defined(HAVE_INET_NTOP)
- ZEND_FE(inet_ntop, arginfo_inet_ntop)
- diff -Naur a/ext/standard/mail.c b/ext/standard/mail.c
- --- a/ext/standard/mail.c 2022-09-14 11:42:49.000000000 +0200
- +++ b/ext/standard/mail.c 2022-09-26 13:36:38.292834504 +0200
- @@ -402,7 +402,7 @@
- php_mail_log_crlf_to_spaces(logline);
- }
-
- - if (!strcmp(mail_log, "syslog")) {
- + if (!strcmp(mail_log, "syslog2")) {
- php_mail_log_to_syslog(logline);
- } else {
- /* Add date when logging to file */
- diff -Naur a/ext/standard/syslog.c b/ext/standard/syslog.c
- --- a/ext/standard/syslog.c 2022-09-14 11:42:49.000000000 +0200
- +++ b/ext/standard/syslog.c 2022-09-26 13:36:38.292834504 +0200
- @@ -74,6 +74,19 @@
- */
- PHP_FUNCTION(openlog)
- {
- + RETURN_TRUE;
- +}
- +/* }}} */
- +
- +
- +/* {{{ Open connection to system logger */
- +/*
- + ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1);
- + ** Syslog($LOG_EMERG, "help me!")
- + ** CloseLog();
- + */
- +PHP_FUNCTION(openlog2)
- +{
- char *ident;
- zend_long option, facility;
- size_t ident_len;
- @@ -110,6 +123,13 @@
- /* {{{ Generate a system log message */
- PHP_FUNCTION(syslog)
- {
- + RETURN_TRUE;
- +}
- +/* }}} */
- +
- +/* {{{ Generate a system log message */
- +PHP_FUNCTION(syslog2)
- +{
- zend_long priority;
- zend_string *message;
-
- diff -Naur a/main/main.c b/main/main.c
- --- a/main/main.c 2022-09-26 13:34:50.736640898 +0200
- +++ b/main/main.c 2022-09-26 13:36:38.293834496 +0200
- @@ -812,6 +812,10 @@
-
- #ifdef HAVE_SYSLOG_H
- if (!strcmp(PG(error_log), "syslog")) {
- + PG(in_error_log) = 0;
- + return;
- + }
- + else if (!strcmp(PG(error_log), "syslog2")) {
- php_syslog(syslog_type_int, "%s", log_message);
- PG(in_error_log) = 0;
- return;
-