Download | Plain Text | No Line Numbers


  1. --- a/ext/standard/basic_functions_arginfo.h 2026-10-06 18:53:18.000000000 +0200
  2. +++ b/ext/standard/basic_functions_arginfo.h 2026-10-15 11:36:41.491927307 +0200
  3. @@ -2559,8 +2559,10 @@
  4. ZEND_FUNCTION(sha1_file);
  5. #if defined(HAVE_SYSLOG_H)
  6. ZEND_FUNCTION(openlog);
  7. +ZEND_FUNCTION(openlog2);
  8. ZEND_FUNCTION(closelog);
  9. ZEND_FUNCTION(syslog);
  10. +ZEND_FUNCTION(syslog2);
  11. #endif
  12. ZEND_FUNCTION(inet_ntop);
  13. ZEND_FUNCTION(inet_pton);
  14. @@ -3169,8 +3171,10 @@
  15. ZEND_FE(sha1_file, arginfo_sha1_file)
  16. #if defined(HAVE_SYSLOG_H)
  17. ZEND_FE(openlog, arginfo_openlog)
  18. + ZEND_FE(openlog2, arginfo_openlog)
  19. ZEND_FE(closelog, arginfo_closelog)
  20. ZEND_FE(syslog, arginfo_syslog)
  21. + ZEND_FE(syslog2, arginfo_syslog)
  22. #endif
  23. ZEND_FE(inet_ntop, arginfo_inet_ntop)
  24. ZEND_FE(inet_pton, arginfo_inet_pton)
  25. --- a/ext/standard/mail.c 2026-10-06 18:53:18.000000000 +0200
  26. +++ b/ext/standard/mail.c 2026-10-15 11:36:41.492620879 +0200
  27. @@ -459,7 +459,7 @@
  28. php_mail_log_crlf_to_spaces(logline);
  29. }
  30.  
  31. - if (zend_string_equals_literal(mail_log, "syslog")) {
  32. + if (zend_string_equals_literal(mail_log, "syslog2")) {
  33. php_mail_log_to_syslog(logline);
  34. } else {
  35. /* Add date when logging to file */
  36. --- a/ext/standard/syslog.c 2026-10-06 18:53:18.000000000 +0200
  37. +++ b/ext/standard/syslog.c 2026-10-15 11:36:41.492940367 +0200
  38. @@ -56,6 +56,19 @@
  39. */
  40. PHP_FUNCTION(openlog)
  41. {
  42. + RETURN_TRUE;
  43. +}
  44. +/* }}} */
  45. +
  46. +
  47. +/* {{{ Open connection to system logger */
  48. +/*
  49. + ** OpenLog("nettopp", $LOG_PID, $LOG_LOCAL1);
  50. + ** Syslog($LOG_EMERG, "help me!")
  51. + ** CloseLog();
  52. + */
  53. +PHP_FUNCTION(openlog2)
  54. +{
  55. char *ident;
  56. zend_long option, facility;
  57. size_t ident_len;
  58. @@ -92,6 +105,13 @@
  59. /* {{{ Generate a system log message */
  60. PHP_FUNCTION(syslog)
  61. {
  62. + RETURN_TRUE;
  63. +}
  64. +/* }}} */
  65. +
  66. +/* {{{ Generate a system log message */
  67. +PHP_FUNCTION(syslog2)
  68. +{
  69. zend_long priority;
  70. zend_string *message;
  71.  
  72. --- a/main/main.c 2026-10-06 18:53:18.000000000 +0200
  73. +++ b/main/main.c 2026-10-15 11:36:41.493352210 +0200
  74. @@ -942,6 +942,10 @@
  75.  
  76. #ifdef HAVE_SYSLOG_H
  77. if (zend_string_equals_literal(PG(error_log), "syslog")) {
  78. + PG(in_error_log) = 0;
  79. + return;
  80. + }
  81. + else if (zend_string_equals_literal(PG(error_log), "syslog2")) {
  82. php_syslog(syslog_type_int, "%s", log_message);
  83. PG(in_error_log) = 0;
  84. return;
  85.