Download | Plain Text | No Line Numbers


  1. diff -Naur php-5.4.11.orig/ext/standard/basic_functions.c php-5.4.11/ext/standard/basic_functions.c
  2. --- php-5.4.11.orig/ext/standard/basic_functions.c 2013-01-16 08:10:30.000000000 +0100
  3. +++ php-5.4.11/ext/standard/basic_functions.c 2013-01-31 14:52:45.000000000 +0100
  4. @@ -2488,6 +2488,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. @@ -2495,6 +2501,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. @@ -3239,7 +3250,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-5.4.11.orig/ext/standard/mail.c php-5.4.11/ext/standard/mail.c
  40. --- php-5.4.11.orig/ext/standard/mail.c 2013-01-16 08:10:30.000000000 +0100
  41. +++ php-5.4.11/ext/standard/mail.c 2013-01-31 14:53:52.000000000 +0100
  42. @@ -254,6 +254,8 @@
  43. }
  44.  
  45. if (!strcmp(mail_log, "syslog")) {
  46. + }
  47. + else 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-5.4.11.orig/ext/standard/php_ext_syslog.h php-5.4.11/ext/standard/php_ext_syslog.h
  52. --- php-5.4.11.orig/ext/standard/php_ext_syslog.h 2013-01-16 08:10:30.000000000 +0100
  53. +++ php-5.4.11/ext/standard/php_ext_syslog.h 2013-01-31 14:52:45.000000000 +0100
  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-5.4.11.orig/ext/standard/syslog.c php-5.4.11/ext/standard/syslog.c
  65. --- php-5.4.11.orig/ext/standard/syslog.c 2013-01-16 08:10:30.000000000 +0100
  66. +++ php-5.4.11/ext/standard/syslog.c 2013-01-31 14:52:45.000000000 +0100
  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. long option, facility;
  87. int ident_len;
  88. @@ -175,6 +189,15 @@
  89. Generate a system log message */
  90. PHP_FUNCTION(syslog)
  91. {
  92. + RETURN_TRUE;
  93. +}
  94. +/* }}} */
  95. +
  96. +
  97. +/* {{{ proto bool syslog2(int priority, string message)
  98. + Generate a system log message */
  99. +PHP_FUNCTION(syslog2)
  100. +{
  101. long priority;
  102. char *message;
  103. int message_len;
  104. diff -Naur php-5.4.11.orig/main/main.c php-5.4.11/main/main.c
  105. --- php-5.4.11.orig/main/main.c 2013-01-16 08:10:30.000000000 +0100
  106. +++ php-5.4.11/main/main.c 2013-01-31 15:09:38.000000000 +0100
  107. @@ -616,6 +616,10 @@
  108. if (PG(error_log) != NULL) {
  109. #ifdef HAVE_SYSLOG_H
  110. if (!strcmp(PG(error_log), "syslog")) {
  111. + PG(in_error_log) = 0;
  112. + return;
  113. + }
  114. + else if (!strcmp(PG(error_log), "syslog2")) {
  115. php_syslog(LOG_NOTICE, "%s", log_message);
  116. PG(in_error_log) = 0;
  117. return;
  118.