helly           Fri Jan  2 13:14:50 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2        zend.c zend_execute_API.c zend_exceptions.c 
                        zend_exceptions.h 
    /php-src/sapi/cli   php_cli.c 
  Log:
  - MFH Catch exceptions in cli -a
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.308.2.12.2.35.2.27&r2=1.308.2.12.2.35.2.28&diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.308.2.12.2.35.2.27 
ZendEngine2/zend.c:1.308.2.12.2.35.2.28
--- ZendEngine2/zend.c:1.308.2.12.2.35.2.27     Wed Dec 31 14:05:22 2008
+++ ZendEngine2/zend.c  Fri Jan  2 13:14:49 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend.c,v 1.308.2.12.2.35.2.27 2008/12/31 14:05:22 helly Exp $ */
+/* $Id: zend.c,v 1.308.2.12.2.35.2.28 2009/01/02 13:14:49 helly Exp $ */
 
 #include "zend.h"
 #include "zend_extensions.h"
@@ -1199,10 +1199,10 @@
                                                }
                                        } else {
                                                
zend_exception_restore(TSRMLS_C);
-                                               
zend_exception_error(EG(exception) TSRMLS_CC);
+                                               
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
                                        }
                                } else {
-                                       zend_exception_error(EG(exception) 
TSRMLS_CC);
+                                       zend_exception_error(EG(exception), 
E_ERROR TSRMLS_CC);
                                }
                        }
                        destroy_op_array(EG(active_op_array) TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.68&r2=1.331.2.20.2.24.2.69&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.68 
ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.69
--- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.68 Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_execute_API.c      Fri Jan  2 13:14:49 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.68 2008/12/31 11:15:32 
sebastian Exp $ */
+/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.69 2009/01/02 13:14:49 helly 
Exp $ */
 
 #include <stdio.h>
 #include <signal.h>
@@ -1184,7 +1184,7 @@
 
        result = zend_eval_string(str, retval_ptr, string_name TSRMLS_CC);
        if (handle_exceptions && EG(exception)) {
-               zend_exception_error(EG(exception) TSRMLS_CC);
+               zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
                result = FAILURE;
        }
        return result;
@@ -1253,7 +1253,7 @@
        zend_execute(CG(active_op_array) TSRMLS_CC);
 
        if (EG(exception)) {
-               zend_exception_error(EG(exception) TSRMLS_CC);
+               zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
        }
 
        CG(active_op_array)->last -= 1; /* get rid of that ZEND_RETURN */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_exceptions.c?r1=1.79.2.6.2.9.2.19&r2=1.79.2.6.2.9.2.20&diff_format=u
Index: ZendEngine2/zend_exceptions.c
diff -u ZendEngine2/zend_exceptions.c:1.79.2.6.2.9.2.19 
ZendEngine2/zend_exceptions.c:1.79.2.6.2.9.2.20
--- ZendEngine2/zend_exceptions.c:1.79.2.6.2.9.2.19     Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_exceptions.c       Fri Jan  2 13:14:49 2009
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_exceptions.c,v 1.79.2.6.2.9.2.19 2008/12/31 11:15:32 sebastian 
Exp $ */
+/* $Id: zend_exceptions.c,v 1.79.2.6.2.9.2.20 2009/01/02 13:14:49 helly Exp $ 
*/
 
 #include "zend.h"
 #include "zend_API.h"
@@ -739,8 +739,8 @@
 }
 /* }}} */
 
-/* This function doesn't return as it calls E_ERROR */
-ZEND_API void zend_exception_error(zval *exception TSRMLS_DC) /* {{{ */
+/* This function doesn't return if it uses E_ERROR */
+ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* 
{{{ */
 {
        zend_class_entry *ce_exception = Z_OBJCE_P(exception);
        if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
@@ -774,9 +774,9 @@
                file = zend_read_property(default_exception_ce, exception, 
"file", sizeof("file")-1, 1 TSRMLS_CC);
                line = zend_read_property(default_exception_ce, exception, 
"line", sizeof("line")-1, 1 TSRMLS_CC);
 
-               zend_error_va(E_ERROR, Z_STRVAL_P(file), Z_LVAL_P(line), 
"Uncaught %s\n  thrown", Z_STRVAL_P(str));
+               zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), 
"Uncaught %s\n  thrown", Z_STRVAL_P(str));
        } else {
-               zend_error(E_ERROR, "Uncaught exception '%s'", 
ce_exception->name);
+               zend_error(severity, "Uncaught exception '%s'", 
ce_exception->name);
        }
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_exceptions.h?r1=1.21.2.1.2.2.2.4&r2=1.21.2.1.2.2.2.5&diff_format=u
Index: ZendEngine2/zend_exceptions.h
diff -u ZendEngine2/zend_exceptions.h:1.21.2.1.2.2.2.4 
ZendEngine2/zend_exceptions.h:1.21.2.1.2.2.2.5
--- ZendEngine2/zend_exceptions.h:1.21.2.1.2.2.2.4      Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_exceptions.h       Fri Jan  2 13:14:49 2009
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_exceptions.h,v 1.21.2.1.2.2.2.4 2008/12/31 11:15:32 sebastian Exp 
$ */
+/* $Id: zend_exceptions.h,v 1.21.2.1.2.2.2.5 2009/01/02 13:14:49 helly Exp $ */
 
 #ifndef ZEND_EXCEPTIONS_H
 #define ZEND_EXCEPTIONS_H
@@ -49,8 +49,8 @@
 
 extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
 
-/* show an exception using zend_error(E_ERROR,...) */
-ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
+/* show an exception using zend_error(severity,...), severity should be 
E_ERROR */
+ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
 
 /* do not export, in php it's available thru spprintf directly */
 int zend_spprintf(char **message, int max_len, char *format, ...);
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.129.2.13.2.22.2.19&r2=1.129.2.13.2.22.2.20&diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.129.2.13.2.22.2.19 
php-src/sapi/cli/php_cli.c:1.129.2.13.2.22.2.20
--- php-src/sapi/cli/php_cli.c:1.129.2.13.2.22.2.19     Wed Dec 31 14:27:09 2008
+++ php-src/sapi/cli/php_cli.c  Fri Jan  2 13:14:49 2009
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_cli.c,v 1.129.2.13.2.22.2.19 2008/12/31 14:27:09 helly Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.22.2.20 2009/01/02 13:14:49 helly Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1123,7 +1123,7 @@
                                        }
 
                                        if (EG(exception)) {
-                                               
zend_exception_error(EG(exception) TSRMLS_CC);
+                                               
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
                                        }
 
                                        php_last_char = '\0';



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to