I work with QuickBooks for windows. And windows app makes call to my backend where in some library script it call exit or die... So I cant catch response and need to detect where exit runs or catch output before exit. For example
try{
$lib->run();
} catch on exit ($output) {
log($output);
}
so maybe anyone knows it calls exit when I enable QuickBooks_WebConnector_Handlers::HOOK_LOGINSUCCESS hook... And debugger shows that it dont enter my function on hook... So it dies before.
I'm the author of the QuickBooks library (https://github.com/consolibyte/quickbooks-php) that you're using.
The library calls exit()/die() for a very good reason -- because if you do anything after the point it calls exit/die at, you'll corrupt the SOAP output and logging of the library and break your QuickBooks integration. There are many, many hook points built into the library specifically to allow you to do any variety of things without having to worry about the calls to exit or die.
Based on what you've said, there's about a 99.9% chance that you're doing something you shouldn't be in the code, or you have PHP or SQL error in your code that you're not seeing.
Post your code, and give us an idea of why you think you need to catch the call to exit/die, and I can edit my question to help you out further.
It is not possible to prevent the execution of exit
The tips is to write your own exit function like this example :
customExit($output){
log($output);
exit;
}
after that you have to search end replace all of exit occurances of PHP language construct, and replace them by customExit($output) function
Hope it helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With