Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.14.4

Bug #15379 win log not working with output_buffering=on
Submitted: 2008-12-22 15:08 UTC
From: talyamin Assigned: jon
Status: Closed Package: Log (version 1.11.3)
PHP Version: 5.2.8 OS: winxp
Roadmaps: 1.11.4    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 41 - 3 = ?

 
 [2008-12-22 15:08 UTC] talyamin (Tal Yamin)
Description: ------------ when u use win log u can'T see results on the new page that open if u have output_buffering=on i soleved it by ... /*********************************************************/ 1. adding new function : /** * Drain the buffer to the output window. * * @access public */ function drainBuffer() { $win = $this->_name; foreach ($this->_buffer as $line) { echo "<script language='JavaScript'>\n"; echo "$win.document.writeln('" . addslashes($line) . "');\n"; echo "self.focus();\n"; echo "</script>\n"; } /* Now that the buffer has been drained, clear it. */ $this->_buffer = array(); } /*********************************************************/ 2. called the function new function from : function close() { /* * If there are still lines waiting to be written, open the output * window so that we can drain the buffer. */ if (!$this->_opened && (count($this->_buffer) > 0)) { $this->open(); } $this->drainBuffer(); if ($this->_opened) { $this->_writeln('</table>'); $this->_writeln('</body></html>'); $this->_opened = false; } return ($this->_opened === false); } /*********************************************************/ 3. called the function new function from : function _writeln($line) { /* Add this line to our output buffer. */ $this->_buffer[] = $line; /* Buffer the output until this page's headers have been sent. */ if (!headers_sent()) { return; } /* If we haven't already opened the output window, do so now. */ if (!$this->_opened && !$this->open()) { return false; } $this->drainBuffer(); } Test script: --------------- <?php require_once "Log.php"; $conf = array('title' => 'Sample Log Output'); $logger = &Log::singleton('win', 'LogWindow', 'ident', $conf); $logger->log("Log entry X"); $logger->log("Log entry XX"); ?> Expected result: ---------------- Time Ident Priority Message 17:00:11.56 ident Info Log entry X 17:00:11.56 ident Info Log entry XX Actual result: -------------- Time Ident Priority Message

Comments

 [2008-12-29 01:28 UTC] jon (Jon Parise)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.