Download | Plain Text | 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 2024-08-14 23:02:49.000000000 +0200
+++ b/ext/standard/basic_functions_arginfo.h 2024-08-21 12:52:39.159934382 +0200
@@ -2534,8 +2534,10 @@
ZEND_FUNCTION(sha1_file);
#if defined(HAVE_SYSLOG_H)
ZEND_FUNCTION(openlog);
+ZEND_FUNCTION(openlog2);
ZEND_FUNCTION(closelog);
ZEND_FUNCTION(syslog);
+ZEND_FUNCTION(syslog2);
#endif
ZEND_FUNCTION(inet_ntop);
ZEND_FUNCTION(inet_pton);
@@ -3172,8 +3174,10 @@
ZEND_FE(sha1_file, arginfo_sha1_file)
#if defined(HAVE_SYSLOG_H)
ZEND_FE(openlog, arginfo_openlog)
+ ZEND_FE(openlog2, arginfo_openlog)
ZEND_FE(closelog, arginfo_closelog)
ZEND_FE(syslog, arginfo_syslog)
+ ZEND_FE(syslog2, arginfo_syslog)
#endif
ZEND_FE(inet_ntop, arginfo_inet_ntop)
ZEND_FE(inet_pton, arginfo_inet_pton)
diff -Naur a/ext/standard/mail.c b/ext/standard/mail.c
--- a/ext/standard/mail.c 2024-08-21 12:45:33.382060637 +0200
+++ b/ext/standard/mail.c 2024-08-21 12:52:39.160934374 +0200
@@ -527,7 +527,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 2024-08-14 23:02:49.000000000 +0200
+++ b/ext/standard/syslog.c 2024-08-21 12:52:39.160934374 +0200
@@ -58,6 +58,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;
@@ -94,6 +107,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 2024-08-21 12:50:07.823054562 +0200
+++ b/main/main.c 2024-08-21 12:52:39.161934367 +0200
@@ -875,6 +875,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;