HTML_Progress2 : The Definitive Guide |
There are many scenarios in which fine-grained control over error raising is absolutely necessary.
The first level to control error generation is the php.ini
directives display_errors and log_errors. When these directives are set to
TRUE
, then browser and file outputs are
effective.
Tip | |
---|---|
If you want to ignore all errors raised (no display, no logs) and
avoid to include PEAR core class, then you should have something
like :
|
Caution | |
---|---|
The previous example will ignore display and logging activity,
but NEVER ignore internal stack error. In other words, you'll
keep always minimum information in the progress stack error.
These informations are :
|
It's up to you to choose your programming way. Just keep in mind this warning, in case of code evolution (error handler configuration). Behavior could change, and you won't keep backward compatibility.
With push_callback option,
you can decides to stop script execution (as done with exceptions by
default: returns PEAR_ERROR_DIE
constant), or continue without filtering (returns NULL
).
If you want to write your own callback function for the push_callback option, this one should have two arguments: first one will get the error code, and second will get error level. These are all the necessary informations to do a filtering. Example that follow show how to be aware that a deprecated function is used in a script.
HTML_Progress2 : The Definitive Guide | v 2.4.0 : April 20, 2007 |