Index: trunk/php/wmerrors/wmerrors.c |
— | — | @@ -5,15 +5,11 @@ |
6 | 6 | |
7 | 7 | #include "php.h" |
8 | 8 | #include "php_ini.h" |
9 | | -#include "ext/standard/info.h" |
10 | 9 | #include "php_wmerrors.h" |
11 | | -#include "php_streams.h" /* for __php_stream_call_depth */ |
| 10 | +#include "ext/standard/php_standard.h" |
12 | 11 | #include "SAPI.h" /* for sapi_module */ |
13 | | -#include "ext/standard/file.h" /* for file_globals aka. FG() */ |
14 | 12 | #include "ext/date/php_date.h" /* for php_format_date */ |
15 | 13 | #include "ext/standard/php_smart_str.h" /* for smart_str */ |
16 | | -#include "ext/standard/php_string.h" /* for php_basename() */ |
17 | | -#include "ext/standard/html.h" /* for php_escape_html_entities */ |
18 | 14 | #include "Zend/zend_builtin_functions.h" /* for zend_fetch_debug_backtrace */ |
19 | 15 | |
20 | 16 | static void wmerrors_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); |
— | — | @@ -41,7 +37,7 @@ |
42 | 38 | PHP_RSHUTDOWN(wmerrors), |
43 | 39 | PHP_MINFO(wmerrors), |
44 | 40 | #if ZEND_MODULE_API_NO >= 20010901 |
45 | | - "1.1.1", |
| 41 | + "1.1.2", |
46 | 42 | #endif |
47 | 43 | STANDARD_MODULE_PROPERTIES |
48 | 44 | }; |
— | — | @@ -250,6 +246,7 @@ |
251 | 247 | char *error_time_str; |
252 | 248 | va_list my_args; |
253 | 249 | php_stream *logfile_stream; |
| 250 | + int old_error_reporting; |
254 | 251 | |
255 | 252 | if ( !WMERRORS_G(enabled) ) { |
256 | 253 | /* Redundant with the caller */ |
— | — | @@ -275,8 +272,13 @@ |
276 | 273 | tmp1_len = vspprintf(&tmp1, 0, format, my_args); |
277 | 274 | va_end(my_args); |
278 | 275 | |
| 276 | + /* Get a date string (without warning messages) */ |
| 277 | + old_error_reporting = EG(error_reporting); |
| 278 | + EG(error_reporting) = 0; |
| 279 | + error_time_str = php_format_date("d-M-Y H:i:s", 11, time(NULL), 1 TSRMLS_CC); |
| 280 | + EG(error_reporting) = old_error_reporting; |
| 281 | + |
279 | 282 | /* Log the error */ |
280 | | - error_time_str = php_format_date("d-M-Y H:i:s", 11, time(NULL), 1 TSRMLS_CC); |
281 | 283 | php_stream_printf(logfile_stream TSRMLS_CC, "[%s] %s: %.*s at %s on line %u%s", |
282 | 284 | error_time_str, wmerrors_error_type_to_string(type), tmp1_len, tmp1, error_filename, |
283 | 285 | error_lineno, PHP_EOL); |
— | — | @@ -343,9 +345,16 @@ |
344 | 346 | HashTable * server_ht; |
345 | 347 | zval **info; |
346 | 348 | smart_str s = {NULL}; |
| 349 | + char *hostname; |
347 | 350 | |
348 | 351 | server_ht = Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]); |
349 | 352 | |
| 353 | + /* Server */ |
| 354 | + hostname = php_get_uname('n'); |
| 355 | + smart_str_appends(&s, "Server: "); |
| 356 | + smart_str_appends(&s, hostname); |
| 357 | + smart_str_appends(&s, PHP_EOL); |
| 358 | + |
350 | 359 | /* Method */ |
351 | 360 | if (SG(request_info).request_method) { |
352 | 361 | smart_str_appends(&s, "Method: "); |
Index: trunk/php/wmerrors/debian/changelog |
— | — | @@ -1,3 +1,11 @@ |
| 2 | +php5-wmerrors (1.1.2-1) lucid; urgency=low |
| 3 | + |
| 4 | + * Fixed incorrect usage of ALLOC_ZVAL() |
| 5 | + * Fixed timezone warning |
| 6 | + * Added logging of server hostname |
| 7 | + |
| 8 | + -- Tim Starling <tstarling@wikimedia.org> Wed, 16 Feb 2011 10:57:19 +1100 |
| 9 | + |
2 | 10 | php5-wmerrors (1.1.1-1) lucid; urgency=low |
3 | 11 | |
4 | 12 | * Fixed missing line break at end of backtrace |