$Date: 2004/07/05 21:31:06 $
IntroductionThis example requires :
This example will show you how to customize errors logs renderer.
An error was volontary made on call of setAnimSpeed() method. By default if you don't specify any logger, a display driver will be added with options below:
To set any logger, it should be defined as an array and given as the last parameter of HTML_Progress class constructor.
Array format :
array(
'display_errors' = 'on' | 'off',
'log_errors' = 'on' | 'off',
'pushCallback' = valid callback for PEAR_ErrorStack,
'msgCallback' = valid callback for PEAR_ErrorStack,
'contextCallback' = valid callback for PEAR_ErrorStack
'handler' => array(
PEAR::Log driverName => array(
'name' => PEAR::Log driver name
'ident' => PEAR::Log driver identification string
'conf' => array( PEAR::Log driver configure options ),
'level' => PEAR::Log driver error level
),
...
)
Print out errors (as a part of the output). For production web sites, you're strongly encouraged to turn this feature off, and use error logging instead. Keeping display_errors enabled on a production web site may reveal security information to end users, such as file paths on your Web server, your database schema or other information.
Log errors into a log file (server-specific log, stderr, syslog ...) As stated above, you're strongly advised to use error logging in place of error displaying on production web sites.
So, if you want to turn OFF all output errors, then you may write:
|
require_once 'HTML/Progress.php'; $logger = array(); $logger['display_errors'] = 'off'; // turn off browser screen output $logger['log_errors'] = 'off'; // turn off all PEAR::Log drivers output $bar = new HTML_Progress($logger); |
I would have a PEAR_ErrorStack structure with context in bold face or any other render.
But the display driver in PEAR::Log 1.8.4 package can't allow it. So i've decided to make a patch.
Here are both versions :
[Top]
Output
Critical : invalid input, parameter #1 "$delay" was expecting "integer", instead got "string"
[class="html_progress" method="setanimspeed" file="E:\EasyPHP\php\PEAR\HTML\Progress.php" line="874"]
[Top]
PHP source syntax highlight[Top]
Play demoRun the script and die on exception.
Run the script and catch exception.
[Top]