Re: php_embed and call_user_function
| From: | Marcus Boerger | Date: | Sat, 12 Mar 2005 11:25:41 +0000 |
| Subject: | Re: php_embed and call_user_function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15395@lists.php.net to get a copy of this message | ||
Hello Phillip,
Saturday, March 12, 2005, 1:35:26 AM, you wrote:
> Im trying to call call_user_function() from inside php_embed.
> It always returns FAILURE...
> Here is the .c file I am trying to use
> (minus the header files, for clarity...)
> int main(int argc, char **argv)
> {
> zval *func;
> zval *zret;
> void ***trsm_ls;
>
>
> if ( php_embed_init(1, argv PTSRMLS_CC) == FAILURE) {
> puts("Failed to load");
> return;
> }
> MAKE_STD_ZVAL(func);
> MAKE_STD_ZVAL(zret);
>
> zend_eval_string("include('test.php');", NULL, "TEST");
>
> func->type = IS_STRING;
> func->value.str.len = 4;
> func->value.str.val = "test";
>
> call_user_function(CG(function_table),NULL,func,zret,0,NULL TSRMLS_CC);
This should be EG(function_table) instead.
>
> php_embed_shutdown(TSRMLS_C);
> }
regards
marcus