Esempio n. 1
0
 public static function Exception($Exception)
 {
     $params = array();
     $params['text'] = '[[CODE_' . $Exception->getCode() . ':' . $Exception->getFile() . ':' . $Exception->getLine() . ']] ' . $Exception->getMessage();
     if (!self::$DisableTime) {
         if (!isset(self::$FirstTime)) {
             self::$FirstTime = microtime(true);
             $params['time'] = 0;
         } else {
             $params['time'] = microtime(true) - self::$FirstTime;
         }
     }
     if (self::$MemUsage && function_exists('memory_get_usage')) {
         $params['mem'] = memory_get_usage();
     }
     $params['level'] = FATAL;
     $params['from'] = self::CallFrom(2);
     $params['fulltrace'] = debug_backtrace();
     self::AddLog($params);
     if (self::$ShowError) {
         if (RD_Util::IsCLI()) {
             echo 'EXCEPTION: ' . $params['text'] . "\n";
         } else {
             echo "<b style='color: red'>EXCEPTION: " . $params['text'] . "</b>\n";
         }
         $Trace = $Exception->getTrace();
         $Trace = self::FormatExceptionTrace($Trace);
         self::EchoTraceDump($Trace);
     }
     if (function_exists('RD_Cleanup')) {
         RD_Cleanup();
     }
     if (function_exists('RDD_FATAL')) {
         RDD_FATAL($Exception);
     } else {
         die('i am out of here');
     }
     return;
 }
Esempio n. 2
0
 function RD_Shutdown_Function()
 {
     if (function_exists('RD_Cleanup')) {
         RD_Cleanup();
     }
 }