Eric,
Thats a good idea. I will try to use your code !
Thanks.
---
MENDES, Guilherme
Em Sex, 2003-10-31 �s 07:15, Eric COLINET escreveu:
> Hi !
>
> I had the same problem, and i solve it by the use of the 'embed' sapi for PHP.
>
> Just link you application with it and you will be able to call (not tested
> but should be near ok):
>
> int run_php_script( const char *script_file ) {
> zend_file_handle file_handle;;
> int argc= 1
> char * argv[]= { "php_embed" };
> int ret;
>
> file_handle.filename = estrdup(script_file);
> file_handle.type = ZEND_HANDLE_FILENAME;
> file_handle.opened_path = NULL;
> file_handle.free_filename = 0;
>
> PHP_EMBED_START_BLOCK( argc, argv );
> ret= php_execute_script( file_handle TSRMLS_CC);
> PHP_EMBED_END_BLOCK();
>
> return ret;
> }
>
> and then call anywhere in your code:
> run_php_script( "myJpGraphCode.php" );
>
> Just a problem: all outputs are on stdout !
> But you can buffer the outputs in the php script and write them to a file.
>
> I hope this will be helpful !
>
> Eric
>
>
> At 20:44 30/10/2003, you wrote:
> >Hi all,
> >
> >It may does not make sense, but I'm writing a web based script in C++
> >and now I need to build 3D pie/bar charts. The best solution and quality
> >I have found was JpGraph that uses PHP Gd Library / Functions.
> >
> >I was thinking about using the PHP source code in my C++ program to
> >generate the charts insted of using the main GD code from Boutell -
> >because the two versions are different, Boutell's GD doesnt have native
> >functions to build 3D images.
> >
> >Is it possible to use the PHP Header in my C++ program to use the
> >features of GD that exits into PHP ?
> >
> >Thanks in advance and sorry if it does not make sense.
> >
> >Regards.
> >MENDES, Guilherme
> >
> >--
> >PHP Internals - PHP Runtime Development Mailing List
> >To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php