PEAR logo

HTML_CSS : 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/CSS.php';
  3.  
  4. $errorConf = array('error_handler' => 'myErrorHandler',
  5.                    'push_callback' => 'myError',
  6.                    // ... more options
  7.                   );
  8. $css = new HTML_CSS(null, $errorConf);
  9. ?>

Table 10.1. Error Handler configuration parameters

Option Type Description
error_handler callback A valid callback (function) to manage errors raised by the HTML_CSS::raiseError() method. Default is: HTML_CSS::_errorHandler
push_callback callback A valid callback (function) that decides to following action. Default return: PEAR_ERROR_DIE if exception, NULL otherwise.
error_callback callback A valid callback (function) that decides to call a real free user function. Default call: none
message_callback callback A valid callback (function) to control message generation. Default is: HTML_CSS_Error::_msgCallback
context_callback callback A valid callback (function) to control error context generation. Default is: HTML_CSS_Error::getBacktrace
handler mixed any handler-specific settings
HTML_CSS : The Definitive Guide v 1.5.0 : January 15, 2008