/**
  * This class implements the Singleton pattern. There is only ever
  * one instance of the this class and it is accessed only via the 
  * ClassName::instance() method.
  * 
  * @return object 
  * @access public
  * @since 5/26/05
  * @static
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new ConcertoErrorPrinter();
     }
     return self::$instance;
 }
Exemple #2
0
        ob_start();
    }
    $harmoni->execute();
    // 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) {
    ConcertoErrorPrinter::handleException($e, 400);
} catch (NullArgumentException $e) {
    ConcertoErrorPrinter::handleException($e, 400);
} catch (PermissionDeniedException $e) {
    ConcertoErrorPrinter::handleException($e, 403);
} catch (UnknownIdException $e) {
    ConcertoErrorPrinter::handleException($e, 404);
} catch (Exception $e) {
    ConcertoErrorPrinter::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('concerto_db');