mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Add experimental APIs to get and clear the last exception
This commit is contained in:
parent
fd3d84ee52
commit
ee36612cef
8 changed files with 150 additions and 2 deletions
|
@ -384,6 +384,36 @@ void java_call_function_handler
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
PHP_FUNCTION(java_last_exception_get)
|
||||
{
|
||||
jlong result = 0;
|
||||
jmethodID lastEx;
|
||||
|
||||
(pval*)(long)result = return_value;
|
||||
|
||||
lastEx = (*jenv)->GetStaticMethodID(jenv, php_reflect, "lastException",
|
||||
"(J)V");
|
||||
|
||||
(*jenv)->CallStaticVoidMethod(jenv, php_reflect, lastEx, result);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
PHP_FUNCTION(java_last_exception_clear)
|
||||
{
|
||||
jlong result = 0;
|
||||
jmethodID clearEx;
|
||||
|
||||
(pval*)(long)result = return_value;
|
||||
|
||||
clearEx = (*jenv)->GetStaticMethodID(jenv, php_reflect, "clearException",
|
||||
"()V");
|
||||
|
||||
(*jenv)->CallStaticVoidMethod(jenv, php_reflect, clearEx);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
static pval _java_getset_property
|
||||
(zend_property_reference *property_reference, jobjectArray value)
|
||||
{
|
||||
|
@ -475,6 +505,8 @@ PHP_MSHUTDOWN_FUNCTION(java) {
|
|||
}
|
||||
|
||||
function_entry java_functions[] = {
|
||||
PHP_FE(java_last_exception_get, NULL)
|
||||
PHP_FE(java_last_exception_clear, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue