Ejemplo n.º 1
0
 * Version header
 */
include GITPHP_INCLUDEDIR . 'version.php';
/**
 * Autoload setup
 */
require GITPHP_INCLUDEDIR . 'AutoLoader.class.php';
spl_autoload_register(array('GitPHP_AutoLoader', 'AutoLoad'));
$router = new GitPHP_Router();
try {
    $controller = $router->GetController();
    if ($controller) {
        $controller->Initialize();
        $controller->RenderHeaders();
        $controller->Render();
    }
} catch (Exception $e) {
    $messageController = $router->GetMessageController();
    $messageController->Initialize();
    if (!$e instanceof GitPHP_MessageException) {
        $config = $messageController->GetConfig();
        if ($config && $config->GetValue('debug')) {
            throw $e;
        }
    }
    $messageController->SetParam('exception', $e);
    $messageController->RenderHeaders();
    $messageController->Render();
    unset($messageController);
}
unset($router);