From: Jost B. <jos...@ya...> - 2005-08-09 18:18:17
|
Hi, this has been implemented in version 2.0.8. A preview is at http://prdownloads.sourceforge.net/php-java-bridge/php-java-bridge_2.0.8pre.zip?download Please see the examples/XML for an example how to call php code from java. The trick is to write a java class which calls your PHP functions. On java level you can catch the PHP exceptions and decide what to call next: interface Proc { public void f(); public void e(Exception e); class test { public void call (Proc p) { try { p.f(); } catch (Exception e) { p.e(e); } } <?php function f() { new java("java.lang.String", null); echo "never reached"; } function e($e) { echo "an exception occured on php level: $e"; } $test=new java('Proc$Test'); $test->call(java_closure()); ?> Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |