|
Posted by hector on 05/13/05 18:11
The DLL module side I think I got a relatively good handle (because there
are plenty of EXT module examples).
It is the PHP script side that I can't see right now. Like would be the PHP
script to use this function some_func() with a structure?
Something like this?
<?PHP
class TFooBar {
var $boo_field;
var $num_field;
var $string_field:
};
$foobar = new(TFoobar);
if (!some_func($foobar)) {
echo "error with function";
exit;
}
echo "Success!";
?>
I did a search (PHP Script passing structure and other various keywords) and
couldn't see anything specifically in this area.
What do you mean by "crack?" I am not familar with that term in this regard.
Thanks
--
Hector Santos, Santronics Software, Inc.
http://www.santronics.com
<chernyshevsky@hotmail.com> wrote in message
news:1115994490.759716.192660@g47g2000cwa.googlegroups.com...
> You would do something like this:
>
> PHP_FUNCTION(some_func)
> {
> zval *obj, *elem;
> TFooBar foo;
>
> zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj);
>
> zend_hash_find(foo, "fBoolean", &elem);
> foo.fBoolean = ZVAL_BOOL(elem);
>
> zend_hash_find(foo, "iNumber", &elem);
> foo.iNumber = ZVAL_BOOL(elem);
>
> }
>
> Basically, you need to crack the structure yourself. They might have
> some funky macros that does it for you though. Google around and maybe
> look through some of the header files.
>
Navigation:
[Reply to this message]
|