function wbMain() { wbCore::init(); list($module, $class, $method) = wbRequest::getController(); // theme override $theme = wbRequest::getVarClean('theme'); if (!empty($theme)) { wbPage::setTheme($theme); } $page = wbRequest::getVarClean('page'); if (!empty($page)) { wbPage::setPage($page); } ob_start(); $modView = wbModule::getView($module, $class, $method); if (ob_get_length() > 0) { $rawOutput = ob_get_contents(); $modView = 'The following lines were printed in raw mode by module, however this should not happen. The module is probably directly calling functions like echo, print, or printf. Please modify the module to exclude direct output. The module is violating Webi architecture principles.<br /><br />' . $rawOutput . '<br /><br />This is the real module output:<br /><br />' . $modView; } ob_end_clean(); wbPage::render($modView); }
public static function showException($e) { if (ob_get_level() > 0) { ob_end_clean(); } $file = self::stripFilePath($e->getFile()); $error = $e->getCode() . " (" . get_class($e) . ")"; $message = $e->getMessage(); $line = $e->getLine(); $backtrace = "<p>" . str_replace("\n", "<br/>", $e->getTraceAsString()) . "</p>"; ob_start(); include 'themes/' . wbPage::getThemeName() . '/templates/exception-error.php'; $errorMsg = ob_get_contents(); ob_end_clean(); wbPage::render($errorMsg); }