cvs: php4 / NEWS configuration-parser.y main.c
| From: | Zeev Suraski | Date: | Fri, 09 Jun 2000 02:18:50 +0000 |
| Subject: | cvs: php4 / NEWS configuration-parser.y main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98@lists.php.net to get a copy of this message | ||
zeev Thu Jun 8 19:18:50 2000 EDT
Modified files:
/php4 NEWS configuration-parser.y main.c
Log:
- 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
Index: php4/NEWS
diff -u php4/NEWS:1.282 php4/NEWS:1.283
--- php4/NEWS:1.282 Thu Jun 8 19:14:55 2000
+++ php4/NEWS Thu Jun 8 19:18:50 2000
@@ -2,12 +2,15 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 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
Index: php4/configuration-parser.y
diff -u php4/configuration-parser.y:1.47 php4/configuration-parser.y:1.48
--- php4/configuration-parser.y:1.47 Tue Jun 6 22:47:24 2000
+++ php4/configuration-parser.y Thu Jun 8 19:18:50 2000
@@ -19,7 +19,7 @@
-/* $Id: configuration-parser.y,v 1.47 2000/06/07 05:47:24 hholzgra Exp $ */
+/* $Id: configuration-parser.y,v 1.48 2000/06/09 02:18:50 zeev Exp $ */
#define DEBUG_CFG_PARSER 0
#include "php.h"
@@ -119,7 +119,19 @@
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);
}
Index: php4/main.c
diff -u php4/main.c:1.264 php4/main.c:1.265
--- php4/main.c:1.264 Thu Jun 8 02:43:12 2000
+++ php4/main.c Thu Jun 8 19:18:50 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.264 2000/06/08 09:43:12 hholzgra Exp $ */
+/* $Id: main.c,v 1.265 2000/06/09 02:18:50 zeev Exp $ */
#include <stdio.h>
@@ -374,13 +374,20 @@
char *prepend_string = INI_STR("error_prepend_string");
char *append_string = INI_STR("error_append_string");
- if (prepend_string) {
- PUTS(prepend_string);
- }
- php_printf("<br>\n<b>%s</b>: %s in <b>%s</b> on line
<b>%d</b><br>\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("<br>\n<b>%s</b>: %s in <b>%s</b> on line
<b>%d</b><br>\n", error_type_str, buffer, error_filename, error_lineno);
+ if (append_string) {
+ PUTS(append_string);
+ }
+ }
}
#if ZEND_DEBUG
{