public static function DoIt() { self::prepareHttpString(); ob_start(); try { $url = new BuUrl2(self::$httpString); bu::setBuUrlInstance($url); self::runController($url); } catch (Exception $e) { ob_end_clean(); $msg = 'Ошибка на сайте'; if (bu::config('rc/debug')) { $msg = get_class($e) . ': ' . $e->getMessage(); } $content = $msg; if (bu::config('rc/debug')) { $content .= sprintf('<br><b>%s</b><br>', get_class($e)); $content .= "<pre>"; foreach (array_reverse($e->getTrace()) as $v) { if (isset($v['line'])) { $content .= $v['line'] . ' ' . $v['file'] . "\n"; } } $content .= "</pre>"; } echo bu::view('layout/panic', array('content' => $content)); } }