Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5142 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95182 invoked by uid 1010); 31 Oct 2003 09:17:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95044 invoked from network); 31 Oct 2003 09:17:33 -0000 Received: from unknown (HELO mwinf0203.wanadoo.fr) (193.252.22.29) by pb1.pair.com with SMTP; 31 Oct 2003 09:17:33 -0000 Received: from enolas.laposte.net (AMontsouris-108-1-14-15.w80-13.abo.wanadoo.fr [80.13.155.15]) by mwinf0203.wanadoo.fr (SMTP Server) with ESMTP id A75E510001E7; Fri, 31 Oct 2003 10:17:32 +0100 (CET) Message-ID: <6.0.0.22.1.20031031094524.01af0630@pop.laposte.net> X-Sender: e.colinet@pop.laposte.net (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Fri, 31 Oct 2003 10:15:24 +0100 To: "Guilherme A. Mendes" Cc: internals@lists.php.net In-Reply-To: <1067543060.641.17.camel@debian.tacnet.com.br> References: <1067543060.641.17.camel@debian.tacnet.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Graphs and Charts From: e.colinet@laposte.net (Eric COLINET) 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