public function func_debugbox($params, &$smarty)
 {
     if (!lib::$debugboxshown) {
         return lib::debugbox();
     }
     return '';
 }
Ejemplo n.º 2
0
    {
    }
}
try {
    $dispatch = new Dispatch();
    $dispatch->parse_request();
    $dispatch->invoke_form_handler();
    $dispatch->find_controller_class();
    $dispatch->create_controller();
    $dispatch->render();
} catch (HTTPException $e) {
    header("HTTP/1.1 " . $e->getCode() . ' ' . $e->getMessage());
    header("Content-type: text/html");
    if ($loc = $e->location()) {
        header("Location: {$loc}");
    }
    print $e->body();
    print lib::debugbox();
} catch (DataException $e) {
    header("HTTP/1.1 404 Data Exception");
    if ($j = $e->value()) {
        $json = new JSON();
        $j = $json->encode($j);
        header("X-JSON: {$j}");
    }
    print $e->body();
} catch (Exception $e) {
    header("HTTP/1.1 500 Internal Error");
    lib::log_exception($e);
    print lib::debugbox();
}