For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > April 2004 > cvs: ZendEngine2 / zend.c zend_exceptions.c zend_exceptions.h









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend.c zend_exceptions.c zend_exceptions.h
Andi Gutmans

2004-04-13, 1:31 pm

andi Tue Apr 13 11:19:21 2004 EDT

Modified files:
/ZendEngine2 zend.c zend_exceptions.c zend_exceptions.h
Log:
- Add hook for exception handler (Derick)


http://cvs.php.net/diff.php/ZendEng...1&r2=1.282&ty=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.281 ZendEngine2/zend.c:1.282
--- ZendEngine2/zend.c:1.281 Tue Mar 30 13:36:53 2004
+++ ZendEngine2/zend.c Tue Apr 13 11:19:21 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend.c,v 1.281 2004/03/30 18:36:53 helly Exp $ */
+/* $Id: zend.c,v 1.282 2004/04/13 15:19:21 andi Exp $ */

#include "zend.h"
#include "zend_extensions.h"
@@ -581,6 +581,7 @@
zend_compile_file = compile_file;
zend_execute = execute;
zend_execute_internal = NULL;
+ zend_throw_exception_hook = NULL;

zend_init_opcodes_handlers();

http://cvs.php.net/diff.php/ZendEng...61&r2=1.62&ty=u
Index: ZendEngine2/zend_exceptions.c
diff -u ZendEngine2/zend_exceptions.c:1.61 ZendEngine2/zend_exceptions.c:1.62
--- ZendEngine2/zend_exceptions.c:1.61 Mon Mar 1 08:29:45 2004
+++ ZendEngine2/zend_exceptions.c Tue Apr 13 11:19:21 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_exceptions.c,v 1.61 2004/03/01 13:29:45 andi Exp $ */
+/* $Id: zend_exceptions.c,v 1.62 2004/04/13 15:19:21 andi Exp $ */

#include "zend.h"
#include "zend_API.h"
@@ -30,6 +30,7 @@
zend_class_entry *default_exception_ce;
static zend_object_handlers default_exception_handlers;
ZEND_API void zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
+ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);


void zend_throw_exception_internal(zval *exception TSRMLS_DC)
@@ -45,6 +46,10 @@
zend_error(E_ERROR, "Exception thrown without a stack frame");
}

+ if (zend_throw_exception_hook) {
+ zend_throw_exception_hook(exception TSRMLS_CC);
+ }
+
if ((EG(current_execute_data)->opline+1)->opcode == ZEND_HANDLE_EXCEPTION) {
/* no need to rethrow the exception */
return;
http://cvs.php.net/diff.php/ZendEng...15&r2=1.16&ty=u
Index: ZendEngine2/zend_exceptions.h
diff -u ZendEngine2/zend_exceptions.h:1.15 ZendEngine2/zend_exceptions.h:1.16
--- ZendEngine2/zend_exceptions.h:1.15 Thu Feb 12 05:38:14 2004
+++ ZendEngine2/zend_exceptions.h Tue Apr 13 11:19:21 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_exceptions.h,v 1.15 2004/02/12 10:38:14 zeev Exp $ */
+/* $Id: zend_exceptions.h,v 1.16 2004/04/13 15:19:21 andi Exp $ */

#ifndef ZEND_EXCEPTIONS_H
#define ZEND_EXCEPTIONS_H
@@ -40,6 +40,8 @@
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
ZEND_API void zend_clear_exception(TSRMLS_D);

+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);

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com