From: Zeev Suraski Date: Fri, 9 Jun 2000 02:18:50 +0000 (+0000) Subject: - Parse errors in the php.ini files under Windows will no longer mess up the X-Git-Tag: PRE_EIGHT_BYTE_ALLOC_PATCH~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=897bb1b572fd33741fdd23d739a3a1923301fec8;p=php - Parse errors in the php.ini files under Windows will no longer mess up the HTTP headers in CGI mode and are now displayed in a message box --- diff --git a/NEWS b/NEWS index ee48eaba5a..4a2e6930a2 100644 --- a/NEWS +++ b/NEWS @@ -2,12 +2,15 @@ PHP 4.0 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2000, Version 4.0.1 -- Fixed crash in OCIFetchStatement() when trying to read after - all data has already been read. (Thies) -- fopen_wrappers() are now extensible via modules +- Parse errors in the php.ini files under Windows will no longer mess up the + HTTP headers in CGI mode and are now displayed in a message box (Zeev) +- Fixed a crash in OCIFetchStatement() when trying to read after all data + has already been read. (Thies) +- fopen_wrappers() are now extensible via modules (Hartmut Holzgraefe) - Make trim strip \0 to match php 3 (Rasmus) - Added function imagecreatefromxbm(). (Jouni) -- Added function imagewbmp(). (Jouni, based on patch from Rune Nordbøe Skillingstad) +- Added function imagewbmp(). (Jouni, based on patch from Rune Nordbøe + Skillingstad) - Added str_pad() for padding a string with an arbitrary string on left or right. (Andrei) - Made the short_tags, asp_tags and allow_call_time_pass_reference INI diff --git a/main/configuration-parser.y b/main/configuration-parser.y index 852e4dc291..0e8b57bced 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -119,7 +119,19 @@ PHPAPI int cfg_get_string(char *varname, char **result) static void yyerror(char *str) { - fprintf(stderr,"PHP: Error parsing %s on line %d\n",currently_parsed_filename,cfglineno); + char *error_buf; + int error_buf_len; + + error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */ + error_buf = (char *) emalloc(error_buf_len); + + sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, cfglineno); +#ifdef PHP_WIN32 + MessageBox(NULL, error_buf, "PHP Error", MB_OK); +#else + fprintf(stderr, "PHP: %s", error_buf); +#endif + efree(error_buf); } diff --git a/main/main.c b/main/main.c index a713c51c11..31ecf101b4 100644 --- a/main/main.c +++ b/main/main.c @@ -374,13 +374,20 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ char *prepend_string = INI_STR("error_prepend_string"); char *append_string = INI_STR("error_append_string"); - if (prepend_string) { - PUTS(prepend_string); - } - php_printf("
\n%s: %s in %s on line %d
\n", error_type_str, buffer, error_filename, error_lineno); - if (append_string) { - PUTS(append_string); - } +#ifdef PHP_WIN32 + if (type==E_CORE_ERROR || type==E_CORE_WARNING) + MessageBox(NULL, buffer, error_type_str, MB_OK); + else +#endif + { + if (prepend_string) { + PUTS(prepend_string); + } + php_printf("
\n%s: %s in %s on line %d
\n", error_type_str, buffer, error_filename, error_lineno); + if (append_string) { + PUTS(append_string); + } + } } #if ZEND_DEBUG {