Download | Plain Text | Line Numbers
diff -Naur php-7.1.2.orig/ext/standard/basic_functions.c php-7.1.2/ext/standard/basic_functions.c
--- php-7.1.2.orig/ext/standard/basic_functions.c 2017-02-17 17:29:20.320484353 +0100
+++ php-7.1.2/ext/standard/basic_functions.c 2017-02-17 17:30:05.190988263 +0100
@@ -2475,6 +2475,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()
@@ -2482,6 +2488,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 */
@@ -3253,7 +3264,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.1.2.orig/ext/standard/mail.c php-7.1.2/ext/standard/mail.c
--- php-7.1.2.orig/ext/standard/mail.c 2017-02-17 17:29:20.321484341 +0100
+++ php-7.1.2/ext/standard/mail.c 2017-02-17 17:30:13.027901620 +0100
@@ -368,7 +368,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.1.2.orig/ext/standard/php_ext_syslog.h php-7.1.2/ext/standard/php_ext_syslog.h
--- php-7.1.2.orig/ext/standard/php_ext_syslog.h 2017-02-17 17:29:20.423483214 +0100
+++ php-7.1.2/ext/standard/php_ext_syslog.h 2017-02-17 17:30:05.191988251 +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.1.2.orig/ext/standard/syslog.c php-7.1.2/ext/standard/syslog.c
--- php-7.1.2.orig/ext/standard/syslog.c 2017-02-17 17:29:20.424483203 +0100
+++ php-7.1.2/ext/standard/syslog.c 2017-02-17 17:30:05.192988241 +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;
@@ -175,6 +189,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.1.2.orig/main/main.c php-7.1.2/main/main.c
--- php-7.1.2.orig/main/main.c 2017-02-17 17:29:20.637480848 +0100
+++ php-7.1.2/main/main.c 2017-02-17 17:30:05.192988241 +0100
@@ -666,6 +666,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;