|
From: <php...@li...> - 2009-01-26 07:39:44
|
Hi,
thanks a lot - this works now for me.
Remarks:
In a different answer you said to someone else:
"Until now this was only possible by asking the PHP object for its ID (through a Java method) and then fetching the object from a global array using the obtained ID as a key."
Isn't it correct to say:
"Before 5.4.3.1 this wasn't possible at all, but since 5.4.3.1 it is possible by asking the PHP object for its ID (through a Java method) and then fetching the object from a global array using the obtained ID as a key."?
Nevertheless this is still not exactly what I wanted/expected:
One still has to go back to Java once (using java_unwrap()) in order to retrieve the ID.
Even better would be an API in Java that would allow to directly send this ID.
I've seen the new methods JavaBridge.unwrapClosure() and PhpProcedure.unwrap().
I may try using these in order to make my solution even better...
Anyway, thanks a lot again for your time and help!
Regards Jürgen
-----Ursprüngliche Nachricht-----
Von: php...@li... [mailto:php...@li...]
Gesendet: Dienstag, 20. Januar 2009 23:14
An: php...@li...
Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objectsasjavaclosures,and in Java call a method on the first closure with thesecondclosureas parameter?
Hi,
> assume you want to unwrap the wrapped PHP object. It might be a good
> idea to extend java_values() this way.
the change is in the cvs head now. The current download version 5.4.3.1 also contains this feature. From the NEWS:
Version 5.4.3.1
* java_unwrap($closure) can now used to retrieve the PHP object
associated with a java_closure(). Example:
class f{function __toString(){return "p";}function toString(){return "j"}};
$cl = java_closure(new f());
echo $cl;
=> j
$cl = java_unwrap($cl)
echo $cl;
=> p
Regards,
Jost Boekemeier
|