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

Bug #28 Small Errorhandling fix
Submitted: 2003-09-22 14:42 UTC
From: info at rhalff dot com Assigned: farell
Status: Closed Package: HTML_Progress
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2003-09-24 22:44 UTC
Package:
Bug Type:
Summary:
From: info at rhalff dot com
New email:
PHP Version: Package Version: OS:

 

 [2003-09-22 14:42 UTC] info at rhalff dot com
Description: ------------ When using strict errorhandling HTML_Progress fails on line 500. Because ob_end_clean want to clean a still empty buffer. This is solved by using a @ in front of ob_end_clean, but it still throws a E_NOTICE. Developers enabling this error level will not be able to run HTML_Progress. From the php manual about the function ob_end_clean : If the function fails it generates an E_NOTICE fix: use ob_get_clean() instead of ob_get_contents. old: $bar = ob_get_contents(); $bar .= $this->_lineEnd; @ob_end_clean(); new: $bar = ob_get_clean(); $bar .= $this->_lineEnd; Reproduce code: --------------- error_reporting(E_ALL); function php_error_handler($errno, $errstr, $errfile, $errline) { die("$errstr in $errfile at line $errline: $errstr"); } set_error_handler('php_error_handler'); require_once ('HTML/Progress/BarHorizontal.php'); $pkg = array('PEAR', 'Config'); $bar = new HTML_Progress_Bar_Horizontal(); for ($i=0; $i<2; $i++) { $bar->display(50); echo "installing package ... : ". $pkg[$i] ."<br /> \n"; } Expected result: ---------------- Cool progressing bar.. Actual result: -------------- ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete. in /usr/lib/php/HTML/Progress.php at line 590: ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete.

Comments

 [2003-09-24 22:44 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!