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 2024-08-14 23:02:49.000000000 +0200
  3. +++ b/ext/standard/basic_functions_arginfo.h 2024-08-21 12:52:39.159934382 +0200
  4. @@ -2534,8 +2534,10 @@
  5. ZEND_FUNCTION(sha1_file);
  6. #if defined(HAVE_SYSLOG_H)
  7. ZEND_FUNCTION(openlog);
  8. +ZEND_FUNCTION(openlog2);
  9. ZEND_FUNCTION(closelog);
  10. ZEND_FUNCTION(syslog);
  11. +ZEND_FUNCTION(syslog2);
  12. #endif
  13. ZEND_FUNCTION(inet_ntop);
  14. ZEND_FUNCTION(inet_pton);
  15. @@ -3172,8 +3174,10 @@
  16. ZEND_FE(sha1_file, arginfo_sha1_file)
  17. #if defined(HAVE_SYSLOG_H)
  18. ZEND_FE(openlog, arginfo_openlog)
  19. + ZEND_FE(openlog2, arginfo_openlog)
  20. ZEND_FE(closelog, arginfo_closelog)
  21. ZEND_FE(syslog, arginfo_syslog)
  22. + ZEND_FE(syslog2, arginfo_syslog)
  23. #endif
  24. ZEND_FE(inet_ntop, arginfo_inet_ntop)
  25. ZEND_FE(inet_pton, arginfo_inet_pton)
  26. diff -Naur a/ext/standard/mail.c b/ext/standard/mail.c
  27. --- a/ext/standard/mail.c 2024-08-21 12:45:33.382060637 +0200
  28. +++ b/ext/standard/mail.c 2024-08-21 12:52:39.160934374 +0200
  29. @@ -527,7 +527,7 @@
  30. php_mail_log_crlf_to_spaces(logline);
  31. }
  32.  
  33. - if (!strcmp(mail_log, "syslog")) {
  34. + if (!strcmp(mail_log, "syslog2")) {
  35. php_mail_log_to_syslog(logline);
  36. } else {
  37. /* Add date when logging to file */
  38. diff -Naur a/ext/standard/syslog.c b/ext/standard/syslog.c
  39. --- a/ext/standard/syslog.c 2024-08-14 23:02:49.000000000 +0200
  40. +++ b/ext/standard/syslog.c 2024-08-21 12:52:39.160934374 +0200
  41. @@ -58,6 +58,19 @@
  42. */
  43. PHP_FUNCTION(openlog)
  44. {
  45. + RETURN_TRUE;
  46. +}
  47. +/* }}} */
  48. +
  49. +
  50. +/* {{{ Open connection to system logger */
  51. +/*
  52. + ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1);
  53. + ** Syslog($LOG_EMERG, "help me!")
  54. + ** CloseLog();
  55. + */
  56. +PHP_FUNCTION(openlog2)
  57. +{
  58. char *ident;
  59. zend_long option, facility;
  60. size_t ident_len;
  61. @@ -94,6 +107,13 @@
  62. /* {{{ Generate a system log message */
  63. PHP_FUNCTION(syslog)
  64. {
  65. + RETURN_TRUE;
  66. +}
  67. +/* }}} */
  68. +
  69. +/* {{{ Generate a system log message */
  70. +PHP_FUNCTION(syslog2)
  71. +{
  72. zend_long priority;
  73. zend_string *message;
  74.  
  75. diff -Naur a/main/main.c b/main/main.c
  76. --- a/main/main.c 2024-08-21 12:50:07.823054562 +0200
  77. +++ b/main/main.c 2024-08-21 12:52:39.161934367 +0200
  78. @@ -875,6 +875,10 @@
  79.  
  80. #ifdef HAVE_SYSLOG_H
  81. if (!strcmp(PG(error_log), "syslog")) {
  82. + PG(in_error_log) = 0;
  83. + return;
  84. + }
  85. + else if (!strcmp(PG(error_log), "syslog2")) {
  86. php_syslog(syslog_type_int, "%s", log_message);
  87. PG(in_error_log) = 0;
  88. return;
  89.