mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString() on Windows)
This commit is contained in:
parent
6b2f3046e8
commit
e229ea6cb7
1 changed files with 7 additions and 1 deletions
|
@ -1114,12 +1114,18 @@ static void php_message_handler_for_zend(long message, void *data)
|
||||||
struct tm *ta, tmbuf;
|
struct tm *ta, tmbuf;
|
||||||
time_t curtime;
|
time_t curtime;
|
||||||
char *datetime_str, asctimebuf[52];
|
char *datetime_str, asctimebuf[52];
|
||||||
|
char memory_leak_buf[4096];
|
||||||
|
|
||||||
time(&curtime);
|
time(&curtime);
|
||||||
ta = php_localtime_r(&curtime, &tmbuf);
|
ta = php_localtime_r(&curtime, &tmbuf);
|
||||||
datetime_str = php_asctime_r(ta, asctimebuf);
|
datetime_str = php_asctime_r(ta, asctimebuf);
|
||||||
datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */
|
datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */
|
||||||
fprintf(stderr, "[%s] Script: '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated));
|
snprintf(memory_leak_buf, sizeof(memory_leak_buf), "[%s] Script: '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated));
|
||||||
|
# if defined(PHP_WIN32)
|
||||||
|
OutputDebugString(memory_leak_buf);
|
||||||
|
# else
|
||||||
|
fprintf(stderr, "%s", memory_leak_buf);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue