diff -Naur php-7.2.0.orig/ext/standard/basic_functions.c php-7.2.0/ext/standard/basic_functions.c --- php-7.2.0.orig/ext/standard/basic_functions.c 2017-11-12 18:57:06.767056261 +0100 +++ php-7.2.0/ext/standard/basic_functions.c 2017-11-12 18:57:19.331911149 +0100 @@ -2492,6 +2492,12 @@ ZEND_ARG_INFO(0, facility) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_openlog2, 0) + ZEND_ARG_INFO(0, ident) + ZEND_ARG_INFO(0, option) + ZEND_ARG_INFO(0, facility) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0) ZEND_END_ARG_INFO() @@ -2499,6 +2505,11 @@ ZEND_ARG_INFO(0, priority) ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO(arginfo_syslog2, 0) + ZEND_ARG_INFO(0, priority) + ZEND_ARG_INFO(0, message) +ZEND_END_ARG_INFO() #endif /* }}} */ /* {{{ type.c */ @@ -3274,7 +3285,9 @@ /* functions from syslog.c */ #ifdef HAVE_SYSLOG_H PHP_FE(openlog, arginfo_openlog) + PHP_FE(openlog2, arginfo_openlog2) PHP_FE(syslog, arginfo_syslog) + PHP_FE(syslog2, arginfo_syslog2) PHP_FE(closelog, arginfo_closelog) #endif diff -Naur php-7.2.0.orig/ext/standard/mail.c php-7.2.0/ext/standard/mail.c --- php-7.2.0.orig/ext/standard/mail.c 2017-11-12 18:57:06.690057150 +0100 +++ php-7.2.0/ext/standard/mail.c 2017-11-12 18:57:19.332911137 +0100 @@ -577,7 +577,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 php-7.2.0.orig/ext/standard/php_ext_syslog.h php-7.2.0/ext/standard/php_ext_syslog.h --- php-7.2.0.orig/ext/standard/php_ext_syslog.h 2017-11-12 18:57:06.766056272 +0100 +++ php-7.2.0/ext/standard/php_ext_syslog.h 2017-11-12 18:57:19.332911137 +0100 @@ -33,7 +33,9 @@ PHP_MSHUTDOWN_FUNCTION(syslog); PHP_FUNCTION(openlog); +PHP_FUNCTION(openlog2); PHP_FUNCTION(syslog); +PHP_FUNCTION(syslog2); PHP_FUNCTION(closelog); #endif diff -Naur php-7.2.0.orig/ext/standard/syslog.c php-7.2.0/ext/standard/syslog.c --- php-7.2.0.orig/ext/standard/syslog.c 2017-11-12 18:57:06.768056249 +0100 +++ php-7.2.0/ext/standard/syslog.c 2017-11-12 18:57:19.332911137 +0100 @@ -134,6 +134,20 @@ */ PHP_FUNCTION(openlog) { + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool openlog2(string ident, int option, int facility) + 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; @@ -177,6 +191,14 @@ Generate a system log message */ PHP_FUNCTION(syslog) { + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool syslog2(int priority, string message) + Generate a system log message */ +PHP_FUNCTION(syslog2) +{ zend_long priority; char *message; size_t message_len; diff -Naur php-7.2.0.orig/main/main.c php-7.2.0/main/main.c --- php-7.2.0.orig/main/main.c 2017-11-12 18:57:06.663057462 +0100 +++ php-7.2.0/main/main.c 2017-11-12 18:57:19.333911126 +0100 @@ -687,6 +687,10 @@ if (PG(error_log) != NULL) { #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;