Re: PHP <-> CORBA
| From: | rubys at us dot ibm dot com | Date: | Thu, 13 Apr 2000 02:02:24 +0000 |
| Subject: | Re: PHP <-> CORBA | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17858@lists.php.net to get a copy of this message | ||
Timothy Ritchey wrote:
> a) am I storing and retrieving the object correctly? assuming obj
> refers to a valid corba object, what sequence of ALLOC_ZVAL,
> pval_copy_constructor, zend_hash_index_update, etc. etc. etc. do I need
> to return the object back to PHP. Even a pointer to documentation would
> help. I have been unable to turn up anything so far, and looking at
> COM.c and java.c and going through the zend source code has gotten me
> nowhere (I guess I am kind of slow).
Disclaimer: I didn't find any formal documentation, everything I learned I
picked up by tracing through the code. Even though I didn't understand PHP
or Zend internals at the time, I had an advantage as I understood both COM
and Java so I could see what I needed to change. Sometimes experience is
the best teacher.
Take a look at Java_net_php_reflect_setResultFromObject. All it does is
create an object. It does assume that INIT_PZVAL was called on the result,
but other than that the routine is self contained. The reason this routine
may not have been obvious to you before is that java_call_function_handler
calls into Java which calls back into this routine.
Most important to understand is that a zend object is a hash table of
properties. Store what data you need in there. In the Java case, I store
a pointer to the Java reference, cast as a long integer.
> b) Assuming there is an Interface Repository with which to grab the
> object interface, I think I am okay. As a fallback, I would like to be
> able to read an IDL file to contruct the dynamic invocation. Assuming a
> valid corba object, I need to pass back to PHP the interface's name
> associated with the object, so that I can properly associate the method
> name (which I can grab from the invocation) with the right interface. I
> don't need the name of the object, but the name of the generic
> interface it represents.
As I said, it is a hash table. Stash as much as you like. Alternately,
stash a single structure which contains as much internal detail as
required.
Good luck, and I'm looking forward to playing with your code.
- Sam Ruby