Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9893 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89962 invoked by uid 1010); 17 May 2004 14:09:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 89927 invoked by uid 1007); 17 May 2004 14:09:04 -0000 Message-ID: <20040517140903.89926.qmail@pb1.pair.com> To: internals@lists.php.net Date: Mon, 17 May 2004 15:07:20 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Posted-By: 81.103.147.238 Subject: Re: Streams - Extensions From: ben.chivers53@ntlworld.com ("Ben Chivers") Hi, I've been looking at the PHP streams source code. I wondered if you could help with this problem i've got with a PHP extension. Any help with this would be very much appreciated! What I want to do is create a php extension which parses php code to the interpreter. e.g. the php script using the php extension will something like this: The extension will look something like this: PHP_FUNCTION { char code[128] = "echo('Hello World');"; size_t bt; php_stream * phpStream = php_stream_open_wrapper("php://stdout", "w", REPORT_ERRORS, NULL); if (stream) { zend_printf("Stream Connected"); bt = php_stream_write(phpStream, code, sizeof(code)); php_stream_close(phpStream); } else { zend_printf("Stream Connection Error"); } } This function would pass the code "echo('Hello World');" to PHP and execute it. What I am having problems is, is retrieving the output of this function e.g. "Hello World". But the problem with PHP is that it's unidirectional (oneway) from what I know. Is there a way to read the output from PHP? What would be the best way of doing that? Would it have anything to do with flushing? Thank you very much for your time. Any help with this would be most appreciated. I wanted to ask you, as you are a developer for PHP, and you developed the php streaming for php extensions and c++ programs. I hope it makes sense. Many Regards, Ben Chivers --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.686 / Virus Database: 447 - Release Date: 14/05/2004