#47123 [NEW]: Robust Output Buffer Control

From: Date: Fri, 16 Jan 2009 03:26:10 +0000
Subject: #47123 [NEW]: Robust Output Buffer Control
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132936@lists.php.net to get a copy of this message
From: shepnorfleet at verizon dot net Operating system: linux PHP version: 5.3.0alpha3 PHP Bug Type: Feature/Change Request Bug description: Robust Output Buffer Control Description: ------------ I would like to request the ability to place output at the front of the existing buffer. I have placed an example CONOP in the 'Reproduce Code' section. I did some experimentation with nesting but it doesn't seem to help me, please see the 'Expected Result' section to see if I understand it correctly. Reproduce code: --------------- <? class Document { ... function __destruct() { /* * By the time I get here the document has accumulated * javascript, and stylesheet includes. My document * object ensures that these occur in the proper place * in the HTML document. */ //New output goes to the front of the buffer. ob_insert(); //write <html><head><title><style><script><body> tags $this->beginHTML(); //Return to normal buffering mode ob_append(); //write defered <script> and </body></html> tags $this->endHTML(); ob_end_flush(); //All done } ?> Expected result: ---------------- <? //Nesting doesn't seem to help ob_start(); print "1"; ob_start(); print "2"; ob_end_flush(); print "3"; ob_end_flush(); ?> output is: 123 not: 213 I need 213 not 123, see? -- Edit bug report at http://bugs.php.net/?id=47123&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47123&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47123&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47123&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47123&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47123&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47123&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47123&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47123&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47123&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47123&r=support Expected behavior: http://bugs.php.net/fix.php?id=47123&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47123&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47123&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47123&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47123&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47123&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47123&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47123&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47123&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47123&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47123&r=mysqlcfg

« previous php.bugs (#132936) next »