]> granicus.if.org Git - php/commitdiff
- Parse errors in the php.ini files under Windows will no longer mess up the
authorZeev Suraski <zeev@php.net>
Fri, 9 Jun 2000 02:18:50 +0000 (02:18 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 9 Jun 2000 02:18:50 +0000 (02:18 +0000)
  HTTP headers in CGI mode and are now displayed in a message box

NEWS
main/configuration-parser.y
main/main.c

diff --git a/NEWS b/NEWS
index ee48eaba5a9e7310342411032bbd6f2c5871e00e..4a2e6930a2d6b9eddb1dd2f3b45c0c6721cff6b1 100644 (file)
--- 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
index 852e4dc29161854d5ae59da463036df667b51afd..0e8b57bced05294e7cd22c1b92c3e75cc79f5a7b 100644 (file)
@@ -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);
 }
 
 
index a713c51c119b3c1e1b6b872b1be832eea6c9b75a..31ecf101b471cc09e6f90f0ac4377b33a722bc56 100644 (file)
@@ -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("<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
                        {