diff options
author | Marcus Boerger <helly@php.net> | 2003-08-21 23:32:13 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-08-21 23:32:13 +0000 |
commit | 0e32aaa8c6992842cc1d299650bdaf8621acf15b (patch) | |
tree | 05f609f40b10f9f497ae61a71de2be11250bbf0d /ext/reflection/php_reflection.c | |
parent | 1b1d077472c451aa7685b9614d9e2e5d81f11710 (diff) | |
download | php-git-0e32aaa8c6992842cc1d299650bdaf8621acf15b.tar.gz |
Add function 'zend_throw_exception(char *message, int duplicate TSRMLS_DC);'
to provide an easy way to throw exceptions for extension developers.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 25 |
1 files changed, 1 insertions, 24 deletions
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 */ |