Download | Plain Text | No Line Numbers


  1. diff -Naur php-7.0.0.orig/ext/standard/basic_functions.c php-7.0.0/ext/standard/basic_functions.c
  2. --- php-7.0.0.orig/ext/standard/basic_functions.c 2015-09-29 23:48:24.000000000 +0200
  3. +++ php-7.0.0/ext/standard/basic_functions.c 2015-10-10 11:39:29.724576774 +0200
  4. @@ -2482,6 +2482,12 @@
  5. ZEND_ARG_INFO(0, facility)
  6. ZEND_END_ARG_INFO()
  7.  
  8. +ZEND_BEGIN_ARG_INFO(arginfo_openlog2, 0)
  9. + ZEND_ARG_INFO(0, ident)
  10. + ZEND_ARG_INFO(0, option)
  11. + ZEND_ARG_INFO(0, facility)
  12. +ZEND_END_ARG_INFO()
  13. +
  14. ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
  15. ZEND_END_ARG_INFO()
  16.  
  17. @@ -2489,6 +2495,11 @@
  18. ZEND_ARG_INFO(0, priority)
  19. ZEND_ARG_INFO(0, message)
  20. ZEND_END_ARG_INFO()
  21. +
  22. +ZEND_BEGIN_ARG_INFO(arginfo_syslog2, 0)
  23. + ZEND_ARG_INFO(0, priority)
  24. + ZEND_ARG_INFO(0, message)
  25. +ZEND_END_ARG_INFO()
  26. #endif
  27. /* }}} */
  28. /* {{{ type.c */
  29. @@ -3237,7 +3248,9 @@
  30. /* functions from syslog.c */
  31. #ifdef HAVE_SYSLOG_H
  32. PHP_FE(openlog, arginfo_openlog)
  33. + PHP_FE(openlog2, arginfo_openlog2)
  34. PHP_FE(syslog, arginfo_syslog)
  35. + PHP_FE(syslog2, arginfo_syslog2)
  36. PHP_FE(closelog, arginfo_closelog)
  37. #endif
  38.  
  39. diff -Naur php-7.0.0.orig/ext/standard/mail.c php-7.0.0/ext/standard/mail.c
  40. --- php-7.0.0.orig/ext/standard/mail.c 2015-09-29 23:48:21.000000000 +0200
  41. +++ php-7.0.0/ext/standard/mail.c 2015-10-10 11:36:43.396699683 +0200
  42. @@ -302,7 +302,7 @@
  43. php_mail_log_crlf_to_spaces(tmp);
  44. }
  45.  
  46. - if (!strcmp(mail_log, "syslog")) {
  47. + if (!strcmp(mail_log, "syslog2")) {
  48. /* Drop the final space when logging to syslog. */
  49. tmp[l - 1] = 0;
  50. php_mail_log_to_syslog(tmp);
  51. diff -Naur php-7.0.0.orig/ext/standard/php_ext_syslog.h php-7.0.0/ext/standard/php_ext_syslog.h
  52. --- php-7.0.0.orig/ext/standard/php_ext_syslog.h 2015-09-29 23:48:24.000000000 +0200
  53. +++ php-7.0.0/ext/standard/php_ext_syslog.h 2015-10-10 11:35:24.451333513 +0200
  54. @@ -33,7 +33,9 @@
  55. PHP_MSHUTDOWN_FUNCTION(syslog);
  56.  
  57. PHP_FUNCTION(openlog);
  58. +PHP_FUNCTION(openlog2);
  59. PHP_FUNCTION(syslog);
  60. +PHP_FUNCTION(syslog2);
  61. PHP_FUNCTION(closelog);
  62.  
  63. #endif
  64. diff -Naur php-7.0.0.orig/ext/standard/syslog.c php-7.0.0/ext/standard/syslog.c
  65. --- php-7.0.0.orig/ext/standard/syslog.c 2015-09-29 23:48:24.000000000 +0200
  66. +++ php-7.0.0/ext/standard/syslog.c 2015-10-10 11:47:39.605051178 +0200
  67. @@ -134,6 +134,20 @@
  68. */
  69. PHP_FUNCTION(openlog)
  70. {
  71. + RETURN_TRUE;
  72. +}
  73. +/* }}} */
  74. +
  75. +
  76. +/* {{{ proto bool openlog2(string ident, int option, int facility)
  77. + Open connection to system logger */
  78. +/*
  79. + ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1);
  80. + ** Syslog($LOG_EMERG, "help me!")
  81. + ** CloseLog();
  82. + */
  83. +PHP_FUNCTION(openlog2)
  84. +{
  85. char *ident;
  86. zend_long option, facility;
  87. size_t ident_len;
  88. @@ -175,6 +189,14 @@
  89. Generate a system log message */
  90. PHP_FUNCTION(syslog)
  91. {
  92. + RETURN_TRUE;
  93. +}
  94. +/* }}} */
  95. +
  96. +/* {{{ proto bool syslog2(int priority, string message)
  97. + Generate a system log message */
  98. +PHP_FUNCTION(syslog2)
  99. +{
  100. zend_long priority;
  101. char *message;
  102. size_t message_len;
  103. diff -Naur php-7.0.0.orig/main/main.c php-7.0.0/main/main.c
  104. --- php-7.0.0.orig/main/main.c 2015-09-29 23:48:27.000000000 +0200
  105. +++ php-7.0.0/main/main.c 2015-10-10 11:33:40.556535522 +0200
  106. @@ -624,6 +624,10 @@
  107. if (PG(error_log) != NULL) {
  108. #ifdef HAVE_SYSLOG_H
  109. if (!strcmp(PG(error_log), "syslog")) {
  110. + PG(in_error_log) = 0;
  111. + return;
  112. + }
  113. + else if (!strcmp(PG(error_log), "syslog2")) {
  114. php_syslog(LOG_NOTICE, "%s", log_message);
  115. PG(in_error_log) = 0;
  116. return;
  117.