summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--main/main.c9
-rw-r--r--php.ini-dist3
-rw-r--r--php.ini-optimized3
-rw-r--r--php.ini-recommended3
5 files changed, 20 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 34d6e620d3..5bc31ede64 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2000, Version 4.0.0 Release
+- Added user_error(), to allow explicitly generate error messages from scripts
+ (Zeev, Zend Engine)
- Fixed long2ip() to return the correct IP address. (Evan)
- Fix many memory leaks in the IMAP module (Stanislav, Andi, Zeev)
- Fix bug in number_format (Jon Forsberg)
diff --git a/main/main.c b/main/main.c
index 531f89a82b..688e37097a 100644
--- a/main/main.c
+++ b/main/main.c
@@ -321,6 +321,9 @@ PHPAPI void php_error(int type, const char *format, ...)
case E_ERROR:
case E_NOTICE:
case E_WARNING:
+ case E_USER_ERROR:
+ case E_USER_WARNING:
+ case E_USER_NOTICE:
if (zend_is_compiling()) {
error_filename = zend_get_compiled_filename(CLS_C);
error_lineno = zend_get_compiled_lineno(CLS_C);
@@ -349,11 +352,13 @@ PHPAPI void php_error(int type, const char *format, ...)
case E_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
+ case E_USER_ERROR:
error_type_str = "Fatal error";
break;
case E_WARNING:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
+ case E_USER_WARNING:
error_type_str = "Warning";
break;
case E_PARSE:
@@ -362,6 +367,9 @@ PHPAPI void php_error(int type, const char *format, ...)
case E_NOTICE:
error_type_str = "Warning";
break;
+ case E_USER_NOTICE:
+ error_type_str = "Notice";
+ break;
default:
error_type_str = "Unknown error";
break;
@@ -400,6 +408,7 @@ PHPAPI void php_error(int type, const char *format, ...)
case E_CORE_ERROR:
/*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */
case E_COMPILE_ERROR:
+ case E_USER_ERROR:
if (module_initialized) {
zend_bailout();
return;
diff --git a/php.ini-dist b/php.ini-dist
index d85489c356..1c03863e98 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -145,6 +145,9 @@ memory_limit = 8388608 ; Maximum amount of memory a script may consume (8MB)
; E_CORE_WARNING - warnings (non fatal errors) that occur during PHP's initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non fatal errors)
+; E_USER_ERROR - user-generated error message
+; E_USER_WARNING - user-generated warning message
+; E_USER_NOTICE - user-generated notice message
; Examples:
; error_reporting = E_ALL & ~E_NOTICE ; show all errors, except for notices
; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; show only errors
diff --git a/php.ini-optimized b/php.ini-optimized
index 9f1d226f8b..64d0346017 100644
--- a/php.ini-optimized
+++ b/php.ini-optimized
@@ -133,6 +133,9 @@ memory_limit = 8388608 ; Maximum amount of memory a script may consume (8MB)
; E_CORE_WARNING - warnings (non fatal errors) that occur during PHP's initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non fatal errors)
+; E_USER_ERROR - user-generated error message
+; E_USER_WARNING - user-generated warning message
+; E_USER_NOTICE - user-generated notice message
; Examples:
; error_reporting = E_ALL & ~E_NOTICE ; show all errors, except for notices
; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; show only errors
diff --git a/php.ini-recommended b/php.ini-recommended
index 9f1d226f8b..64d0346017 100644
--- a/php.ini-recommended
+++ b/php.ini-recommended
@@ -133,6 +133,9 @@ memory_limit = 8388608 ; Maximum amount of memory a script may consume (8MB)
; E_CORE_WARNING - warnings (non fatal errors) that occur during PHP's initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non fatal errors)
+; E_USER_ERROR - user-generated error message
+; E_USER_WARNING - user-generated warning message
+; E_USER_NOTICE - user-generated notice message
; Examples:
; error_reporting = E_ALL & ~E_NOTICE ; show all errors, except for notices
; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; show only errors