Esempio n. 1
0
        // If we were not forwarded, re-throw
        throw $e;
    }
    // Handle certain types of uncaught exceptions specially. In particular,
    // Send back HTTP Headers indicating that an error has ocurred to help prevent
    // crawlers from continuing to pound invalid urls.
} catch (UnknownActionException $e) {
    SegueErrorPrinter::handleException($e, 404);
} catch (NullArgumentException $e) {
    SegueErrorPrinter::handleException($e, 400);
} catch (PermissionDeniedException $e) {
    SegueErrorPrinter::handleException($e, 403);
} catch (UnknownIdException $e) {
    SegueErrorPrinter::handleException($e, 404);
} catch (Exception $e) {
    SegueErrorPrinter::handleException($e, 500);
}
if (defined('ENABLE_TIMERS') && ENABLE_TIMERS) {
    $execTimer->end();
    $output = ob_get_clean();
    ob_start();
    print "\n<table>\n<tr><th align='right'>Execution Time:</th>\n<td align='right'><pre>";
    printf("%1.6f", $execTimer->printTime());
    print "</pre></td></tr>\n</table>";
    $dbhandler = Services::getService("DBHandler");
    printpre("NumQueries: " . $dbhandler->getTotalNumberOfQueries());
    if (isset($dbhandler->recordQueryCallers) && $dbhandler->recordQueryCallers) {
        print $dbhandler->getQueryCallerStats();
    }
    try {
        $db = Harmoni_Db::getDatabase('segue_db');