<?php

include_once("internal/log.php");

// set to log PHP errors 
function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
	_log("PHP ERROR " . $errno . ": " . $errstr);
	_log("file "  . $errfile . ", line " . $errline);
	return TRUE;
}

function check_for_fatal() {
	$error = error_get_last();
	_log("FATAL PHP ERROR " . $error["type"] . ": " . $error["message"]);
	_log("file "  . $error["file"] . ", line " . $error["line"]);
}

register_shutdown_function( "check_for_fatal" );
ini_set( "display_errors", "off" );
set_error_handler("error_handler", E_ALL);

?>