From 0e32aaa8c6992842cc1d299650bdaf8621acf15b Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 21 Aug 2003 23:32:13 +0000 Subject: Add function 'zend_throw_exception(char *message, int duplicate TSRMLS_DC);' to provide an easy way to throw exceptions for extension developers. --- ext/reflection/php_reflection.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 81d9b4d72b..6664e347ba 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -47,31 +47,8 @@ /* Exception throwing macro */ #define _DO_THROW(msg) \ - { \ - extern zend_class_entry *default_exception_ptr; \ - zval *ex; \ - zval *tmp; \ - MAKE_STD_ZVAL(ex); \ - object_init_ex(ex, default_exception_ptr); \ - \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_STRING(tmp, (msg), 1); \ - zend_hash_update(Z_OBJPROP_P(ex), "message", sizeof("message"), (void **) &tmp, sizeof(zval *), NULL); \ - tmp = NULL; \ - \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_STRING(tmp, zend_get_executed_filename(TSRMLS_C), 1); \ - zend_hash_update(Z_OBJPROP_P(ex), "file", sizeof("file"), (void **) &tmp, sizeof(zval *), NULL); \ - tmp = NULL; \ - \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_LONG(tmp, zend_get_executed_lineno(TSRMLS_C)); \ - zend_hash_update(Z_OBJPROP_P(ex), "line", sizeof("line"), (void **) &tmp, sizeof(zval *), NULL); \ - tmp = NULL; \ - \ - EG(exception) = ex; \ + zend_throw_exception(msg, 1 TSRMLS_CC); \ return; \ - } /* Smart string macros */ -- cgit v1.2.1