Download | Plain Text | Line Numbers


diff -Naur php-7.0.0.orig/ext/standard/basic_functions.c php-7.0.0/ext/standard/basic_functions.c
--- php-7.0.0.orig/ext/standard/basic_functions.c	2015-09-29 23:48:24.000000000 +0200
+++ php-7.0.0/ext/standard/basic_functions.c	2015-10-10 11:39:29.724576774 +0200
@@ -2482,6 +2482,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()
 
@@ -2489,6 +2495,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 */
@@ -3237,7 +3248,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.0.0.orig/ext/standard/mail.c php-7.0.0/ext/standard/mail.c
--- php-7.0.0.orig/ext/standard/mail.c	2015-09-29 23:48:21.000000000 +0200
+++ php-7.0.0/ext/standard/mail.c	2015-10-10 11:36:43.396699683 +0200
@@ -302,7 +302,7 @@
 			php_mail_log_crlf_to_spaces(tmp);
 		}
 
-		if (!strcmp(mail_log, "syslog")) {
+		if (!strcmp(mail_log, "syslog2")) {
 			/* Drop the final space when logging to syslog. */
 			tmp[l - 1] = 0;
 			php_mail_log_to_syslog(tmp);
diff -Naur php-7.0.0.orig/ext/standard/php_ext_syslog.h php-7.0.0/ext/standard/php_ext_syslog.h
--- php-7.0.0.orig/ext/standard/php_ext_syslog.h	2015-09-29 23:48:24.000000000 +0200
+++ php-7.0.0/ext/standard/php_ext_syslog.h	2015-10-10 11:35:24.451333513 +0200
@@ -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.0.0.orig/ext/standard/syslog.c php-7.0.0/ext/standard/syslog.c
--- php-7.0.0.orig/ext/standard/syslog.c	2015-09-29 23:48:24.000000000 +0200
+++ php-7.0.0/ext/standard/syslog.c	2015-10-10 11:47:39.605051178 +0200
@@ -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.0.0.orig/main/main.c php-7.0.0/main/main.c
--- php-7.0.0.orig/main/main.c	2015-09-29 23:48:27.000000000 +0200
+++ php-7.0.0/main/main.c	2015-10-10 11:33:40.556535522 +0200
@@ -624,6 +624,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(LOG_NOTICE, "%s", log_message);
 			PG(in_error_log) = 0;
 			return;