Download | Plain Text | No Line Numbers


  1. diff -Naur a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
  2. --- a/ext/standard/basic_functions_arginfo.h 2020-07-21 10:49:31.000000000 +0200
  3. +++ b/ext/standard/basic_functions_arginfo.h 2020-07-24 23:34:09.954388311 +0200
  4. @@ -2425,12 +2425,14 @@
  5. ZEND_FUNCTION(sha1_file);
  6. #if defined(HAVE_SYSLOG_H)
  7. ZEND_FUNCTION(openlog);
  8. +ZEND_FUNCTION(openlog2);
  9. #endif
  10. #if defined(HAVE_SYSLOG_H)
  11. ZEND_FUNCTION(closelog);
  12. #endif
  13. #if defined(HAVE_SYSLOG_H)
  14. ZEND_FUNCTION(syslog);
  15. +ZEND_FUNCTION(syslog2);
  16. #endif
  17. #if defined(HAVE_INET_NTOP)
  18. ZEND_FUNCTION(inet_ntop);
  19. @@ -3062,12 +3064,14 @@
  20. ZEND_FE(sha1_file, arginfo_sha1_file)
  21. #if defined(HAVE_SYSLOG_H)
  22. ZEND_FE(openlog, arginfo_openlog)
  23. + ZEND_FE(openlog2, arginfo_openlog)
  24. #endif
  25. #if defined(HAVE_SYSLOG_H)
  26. ZEND_FE(closelog, arginfo_closelog)
  27. #endif
  28. #if defined(HAVE_SYSLOG_H)
  29. ZEND_FE(syslog, arginfo_syslog)
  30. + ZEND_FE(syslog2, arginfo_syslog)
  31. #endif
  32. #if defined(HAVE_INET_NTOP)
  33. ZEND_FE(inet_ntop, arginfo_inet_ntop)
  34. diff -Naur a/ext/standard/mail.c b/ext/standard/mail.c
  35. --- a/ext/standard/mail.c 2020-07-24 12:09:25.650430728 +0200
  36. +++ b/ext/standard/mail.c 2020-07-24 12:35:55.695234580 +0200
  37. @@ -402,7 +402,7 @@
  38. php_mail_log_crlf_to_spaces(logline);
  39. }
  40.  
  41. - if (!strcmp(mail_log, "syslog")) {
  42. + if (!strcmp(mail_log, "syslog2")) {
  43. php_mail_log_to_syslog(logline);
  44. } else {
  45. /* Add date when logging to file */
  46. diff -Naur a/ext/standard/syslog.c b/ext/standard/syslog.c
  47. --- a/ext/standard/syslog.c 2020-07-21 10:49:31.000000000 +0200
  48. +++ b/ext/standard/syslog.c 2020-07-24 12:35:55.696234573 +0200
  49. @@ -134,6 +134,19 @@
  50. */
  51. PHP_FUNCTION(openlog)
  52. {
  53. + RETURN_TRUE;
  54. +}
  55. +/* }}} */
  56. +
  57. +
  58. +/* {{{ Open connection to system logger */
  59. +/*
  60. + ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1);
  61. + ** Syslog($LOG_EMERG, "help me!")
  62. + ** CloseLog();
  63. + */
  64. +PHP_FUNCTION(openlog2)
  65. +{
  66. char *ident;
  67. zend_long option, facility;
  68. size_t ident_len;
  69. @@ -173,6 +187,13 @@
  70. /* {{{ Generate a system log message */
  71. PHP_FUNCTION(syslog)
  72. {
  73. + RETURN_TRUE;
  74. +}
  75. +/* }}} */
  76. +
  77. +/* {{{ Generate a system log message */
  78. +PHP_FUNCTION(syslog2)
  79. +{
  80. zend_long priority;
  81. zend_string *message;
  82.  
  83. diff -Naur a/main/main.c b/main/main.c
  84. --- a/main/main.c 2020-07-24 12:24:12.510675800 +0200
  85. +++ b/main/main.c 2020-07-24 12:35:55.697234565 +0200
  86. @@ -795,6 +795,10 @@
  87. if (PG(error_log) != NULL) {
  88. #ifdef HAVE_SYSLOG_H
  89. if (!strcmp(PG(error_log), "syslog")) {
  90. + PG(in_error_log) = 0;
  91. + return;
  92. + }
  93. + else if (!strcmp(PG(error_log), "syslog2")) {
  94. php_syslog(syslog_type_int, "%s", log_message);
  95. PG(in_error_log) = 0;
  96. return;
  97.