<?php
session_start();
use Phppot\Routine\Core\ErrorHandler;
use Zeus\Config;
use Zeus\Controller\Dispatcher;

require_once __DIR__ . "/vendor/autoload.php";
if (Config::DEBUG == true) {
    $errorHandler = new ErrorHandler(Config::LOG_FILE, Config::DEBUG);
    set_error_handler(array(
        $errorHandler,
        'errorHandler'
    ));

    set_exception_handler(array(
        $errorHandler,
        'exceptionHandler'
    ));

    register_shutdown_function(array(
        $errorHandler,
        'shutdown'
    ));
} else {
    error_reporting(0);
}
$dispatcher = new Dispatcher();
$dispatcher->dispatch();
