<?php
class ErrorHandler {
var $_errors;
function ErrorHandler(){
$this->_errors = array();
}
function addError($error) {
$this->_errors[] = $error;
}
function handler($errno, $errstr, $file, $line) {
$this->addError(htmlspecialchars($errstr) . ' in <strong>' . htmlspecialchars($file) . '</strong> on line <strong>' . $line . '</strong>');
}
function hasErrors() {
return (count($this->_errors) > 0) ? true : false;
}
function getErrors() {
return $this->_errors;
}
}
function farodp_error($errno, $errstr, $errfile, $errline)
{
global $errorHandler;
$errorHandler->handler($errno, $errstr, $errfile, $errline);
}
?>