PEAR Progress2 logo

HTML_Progress2 : The Definitive Guide

Configuring a Handler

A error handler's configuration is determined by the arguments used in its construction. Here's an overview of these parameters.

  1. <?php
  2. require_once 'HTML/Progress2.php';
  3.  
  4. $errorConf = array('error_handler' => 'myErrorHandler',
  5.                    'push_callback' => 'myError',
  6.                    // ... more options
  7.                   );
  8. $meter = new HTML_Progress2($errorConf);
  9. ?>

Table 16.1. Error Handler configuration parameters

Option Type Description
error_handler callback A valid callback (function) to manage errors raised by the HTML_Progress2::raiseError() method. Default is: HTML_Progress2::_errorHandler
push_callback callback A valid callback (function) that decides to following action. Default return: PEAR_ERROR_DIE if exception, NULL otherwise.
message_callback callback A valid callback (function) to control message generation. Default is: HTML_Progress2_Error::_msgCallback
context_callback callback A valid callback (function) to control error context generation. Default is: HTML_Progress2_Error::getBacktrace
handler mixed any handler-specific settings
HTML_Progress2 : The Definitive Guide v 2.4.0 : April 20, 2007