You are here: Re: Hooking server DLL into PHP « PHP Programming Language « IT news, forums, messages
Re: Hooking server DLL into PHP

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация