/** * Checks for fatal errors on shutdown */ public static function ShutdownHandler() { if ($error = error_get_last()) { $exception = 'Oka\\Exceptions\\' . Debug::ErrorTypeToExceptionName($error['type']); self::ExceptionHandler(new $exception($error['message'], $error['type'], 1, $error['file'], $error['line'])); } }
/** * Display last error */ public static function DisplayError() { if (\App\Application::$debug) { $name = 'Default/500/Debug'; $report = Misc\Debug::DumpSilent(self::$displayData); } else { $name = 'Default/500/Error'; $key = Cipher\Password::Hash(microtime(true) . rand(1, 99999)); $report = $key . \Oka\Cipher::Encrypt(serialize(self::$displayData[1]), $key, true); } $page = new Web\View($name); $page->exception = self::$displayData[0]; $page->report = htmlentities($report); $page->render(); }