<?php

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . '/../' . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . '/../classes/');
require_once 'data/mysql-connection.class.php';
require_once 'context/stoolball-settings.class.php';
require_once 'context/site-context.class.php';
require_once 'stoolball/match-manager.class.php';
require_once 'xhtml/html.class.php';
require_once "Zend/Feed.php";
# set up error handling, unless local and using xdebug
$settings = new StoolballSettings();
if (!SiteContext::IsDevelopment()) {
    require_once 'page/exception-manager.class.php';
    require_once 'page/email-exception-publisher.class.php';
    $errors = new ExceptionManager(array(new EmailExceptionPublisher($settings->GetTechnicalContactEmail())));
    # Use production settings recommended by
    # http://perishablepress.com/advanced-php-error-handling-via-htaccess/
    # Not possible to set in .htaccess because PHP is running as a CGI. This is the
    # next best thing.
    ini_set("display_startup_errors", "off");
    ini_set("display_errors", "off");
    ini_set("html_errors", "off");
    ini_set("log_errors", "on");
    ini_set("ignore_repeated_errors", "off");
    ini_set("ignore_repeated_source", "off");
    ini_set("report_memleaks", "on");
    ini_set("track_errors", "on");
    ini_set("docref_root", "0");
    ini_set("docref_ext", "0");
    ini_set("error_reporting", "-1");
    ini_set("log_errors_max_len", "0");