Hi, i have a question on zend_eval_string
| From: | xiangchao liu | Date: | Wed, 12 May 2010 02:56:49 +0000 |
| Subject: | Hi, i have a question on zend_eval_string | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-7221@lists.php.net to get a copy of this message | ||
Hi:
How can i call zend_eval_string() in PHP_MINIT_FUNCTION block?
For some reason i want to register my PHP functions in PHP_MINIT_FUNCTION,
so that i do not have to define them in my .php files. Just like:
PHP_FUNCTION(if_is_nil) {
zend_eval_string("function if_real_is_nil($value) {\
return $value === nil;\
}", NULL, "if_real_is_nil" TSRMLS_CC);
}
When i call if_is_nil, the function if_real_is_nil() is defined.so i can
call it later.
But, when i move zend_eval_string(...) to PHP_MINIT_FUNCTION block, compiler
goes well, but can not apache can not load the module anymore.
Is there anyone knows how to get this work?
Thanks in advanced.