Download | Plain Text | Line Numbers


--- a/ext/standard/basic_functions_arginfo.h	2026-10-06 18:53:18.000000000 +0200
+++ b/ext/standard/basic_functions_arginfo.h	2026-10-15 11:36:41.491927307 +0200
@@ -2559,8 +2559,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);
@@ -3169,8 +3171,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)
--- a/ext/standard/mail.c	2026-10-06 18:53:18.000000000 +0200
+++ b/ext/standard/mail.c	2026-10-15 11:36:41.492620879 +0200
@@ -459,7 +459,7 @@
 			php_mail_log_crlf_to_spaces(logline);
 		}
 
-		if (zend_string_equals_literal(mail_log, "syslog")) {
+		if (zend_string_equals_literal(mail_log, "syslog2")) {
 			php_mail_log_to_syslog(logline);
 		} else {
 			/* Add date when logging to file */
--- a/ext/standard/syslog.c	2026-10-06 18:53:18.000000000 +0200
+++ b/ext/standard/syslog.c	2026-10-15 11:36:41.492940367 +0200
@@ -56,6 +56,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;
@@ -92,6 +105,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;
 
--- a/main/main.c	2026-10-06 18:53:18.000000000 +0200
+++ b/main/main.c	2026-10-15 11:36:41.493352210 +0200
@@ -942,6 +942,10 @@
 
 #ifdef HAVE_SYSLOG_H
 		if (zend_string_equals_literal(PG(error_log), "syslog")) {
+			PG(in_error_log) = 0;
+			return;
+		}
+		else if (zend_string_equals_literal(PG(error_log), "syslog2")) {
 			php_syslog(syslog_type_int, "%s", log_message);
 			PG(in_error_log) = 0;
 			return;