/** * PHP Error handler * * @param integer $code * @param string $message * @param string $file * @param integer $line * @param array $context */ public static function handle($code, $message, $file = null, $line = null, array $context = array()) { /** * @see Zym_Error */ require_once 'Zym/Error.php'; // Create error object $error = new Zym_Error($code, $message, $file, $line, $context); /** * @see Zym_Error_Stack */ require_once 'Zym/Error/Stack.php'; // Store error Zym_Error_Stack::getInstance()->push($error); }
/** * PHP Error handler * * @param integer $code * @param string $message * @param string $file * @param integer $line * @param array $context * @return boolean */ public static function handle($code, $message, $file = null, $line = null, array $context = array()) { // Skip suppressed errors @ if (error_reporting() == 0) { return false; } /** * @see Zym_Error */ require_once 'Zym/Error.php'; // Create error object $trace = debug_backtrace(); $error = new Zym_Error($code, $message, $file, $line, $context, $trace); /** * @see Zym_Error_Stack */ require_once 'Zym/Error/Stack.php'; // Store error Zym_Error_Stack::getInstance()->push($error); return true; }