Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38033 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58651 invoked from network); 31 May 2008 16:45:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2008 16:45:28 -0000 Received: from [127.0.0.1] ([127.0.0.1:19692]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 98/90-54820-8A081484 for ; Sat, 31 May 2008 12:45:28 -0400 X-Host-Fingerprint: 66.51.222.14 unknown Received: from [66.51.222.14] ([66.51.222.14:29464] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/10-54820-A2C71484 for ; Sat, 31 May 2008 12:26:20 -0400 Message-ID: To: internals@lists.php.net Date: Sat, 31 May 2008 09:28:11 -0700 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 66.51.222.14 Subject: Assistance using php_start_ob_buffer From: spamthis@dslextreme.com (Eric Len) Hi, I'm trying to write an extension that(running under php in fcgi mode) does the equivalent of -php.ini auto_prepend_file = start.inc auto_append_file = end.inc -start.inc ob_start() -end.inc $len = ob_get_length() // modify buffer slightly based on length value // php prints final buffer on script termination So I thought I merely needed to do the C equivalent of these, in short: RINIT php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC); RSHUTDOWN zval * outbuf = NULL; zval outbuflen; INIT_ZVAL(outbuflen); if ( php_ob_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_L_VAL(outbuflen) != 0 ) { ALLOC_INIT_ZVAL(outbuf); php_ob_get_buffer(outbuf TSRMLS_CC); // Modify buffer based on len parameter } // Done php prints buffer by itself on script return However no matter what variation on the above I've tried, including different php_ob_* api calls I can't ever get any buffer length(I do see script data output). It's like ob_start() was never called. In php.ini I have output_buffering = Off Can someone please point out what I'm missing here? thanks! Dal Eric Len