Re: Help with calling PHP functions
| From: | Edward Z. Yang | Date: | Sat, 26 Apr 2008 18:45:45 +0000 |
| Subject: | Re: Help with calling PHP functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37247@lists.php.net to get a copy of this message | ||
Dhiru Pandey wrote:
> I am trying to figure out a way to invoke PHP functions directly i.e.
> bypassing the PHP compiler (scanner and parser). For now it would be
> great if I can get some help calling them from C. Ultimately I would
> like to call them from Java.
It's not difficult to call PHP_FUNCTIONs if you're inside PHP: you
create a zval with the appropriate callback value (a string if you're
dealing with global PHP functions) and then use call_user_function. You
can find detailed instructions here:
http://www.php.net/~wez/extending-php.pdf
Can't help you for the other, although "Extending and Embedding PHP" by
Sara Golemon, George Schlossnagle and Wez Furlong covers that topic, I
think.
--
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]