diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-17 13:14:18 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-17 13:14:18 +0200 |
| commit | 1b63528d3897c03e8dd0991a1e8438db8363be4f (patch) | |
| tree | ed555ba1623ded3e28144e17715b1911cdc9d9b3 /main | |
| parent | d584f92195658b153a3898edac766ef09edf72b6 (diff) | |
| parent | 9f0515c40c85d9c22cf46f7c42338354c398e4a7 (diff) | |
| download | php-git-1b63528d3897c03e8dd0991a1e8438db8363be4f.tar.gz | |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'main')
| -rw-r--r-- | main/main.c | 4 | ||||
| -rw-r--r-- | main/php_syslog.c | 7 | ||||
| -rw-r--r-- | main/php_syslog.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c index a6c51e79f0..f87d07a192 100644 --- a/main/main.c +++ b/main/main.c @@ -344,6 +344,10 @@ static PHP_INI_MH(OnSetLogFilter) PG(syslog_filter) = PHP_SYSLOG_FILTER_ASCII; return SUCCESS; } + if (!strcmp(filter, "raw")) { + PG(syslog_filter) = PHP_SYSLOG_FILTER_RAW; + return SUCCESS; + } return FAILURE; } diff --git a/main/php_syslog.c b/main/php_syslog.c index bac29a9042..987ef9cc0c 100644 --- a/main/php_syslog.c +++ b/main/php_syslog.c @@ -76,6 +76,13 @@ PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */ smart_string_0(&fbuf); va_end(args); + if (PG(syslog_filter) == PHP_SYSLOG_FILTER_RAW) { + /* Just send it directly to the syslog */ + syslog(priority, "%.*s", (int)fbuf.len, fbuf.c); + smart_string_free(&fbuf); + return; + } + for (ptr = fbuf.c; ; ++ptr) { c = *ptr; if (c == '\0') { diff --git a/main/php_syslog.h b/main/php_syslog.h index b5df765ddd..2c499269a4 100644 --- a/main/php_syslog.h +++ b/main/php_syslog.h @@ -34,6 +34,7 @@ #define PHP_SYSLOG_FILTER_ALL 0 #define PHP_SYSLOG_FILTER_NO_CTRL 1 #define PHP_SYSLOG_FILTER_ASCII 2 +#define PHP_SYSLOG_FILTER_RAW 3 BEGIN_EXTERN_C() PHPAPI void php_syslog(int, const char *format, ...); |
