Hi, i have a question on zend_eval_string
[email protected] (xiangchao liu) Wed, 12 May 2010 10:56:49 +0800
| Newsgroups | php.pecl.dev |
|---|---|
| Message-ID | <[email protected]> |
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.