Re: cry for execute a php code into a PHP_FE function
| From: | Devon O'Dell | Date: | Fri, 13 Sep 2002 08:33:20 +0000 |
| Subject: | Re: cry for execute a php code into a PHP_FE function | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-88301@lists.php.net to get a copy of this message | ||
Ahem, I decided I would be nice and give you some code. You can find example code in many files in the sapi/ directory. I suggest really browsing the code to understand how it works.
zend_file_handle file_handle;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = [file path];
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
if (php_request_startuf(TSRMLS_C) == FAILURE) {
return;
}
php_execute_script(&file_handle TSRMLS_CC);
php_request_shutdown(NULL);
That's pretty basic. The code is, of course, a bit different if you're not working with files, but that should be enough to get you started. If not, check out http://lxr.php.net and search for php_execute_script *or* zend_file_handle file_handle (all the instances where this is done, the file is initialized this way, so I suggest you do the same).
Devon
eminent wrote:
Hi all, i am crying beacause i didn't understand how to execute php code inside a PHP_FE function. Markus sayd that i have to use php_execute_script defined into main/main.c but i didn't understood how to use it. Can anyone help me? thanks MAX